What is the observation made in the following JavaScript code?

var count = [1,,3];

a) The omitted value takes “undefined”
b) This results in an error
c) This results in an exception
d) The omitted value takes an integer value

2 Likes

b) This results in an error

2 Likes

@nagesh28katke ,

Answer: a)The omitted value takes “undefined”

Explanation: Array is defined with a null value when no value is mentioned. If you omit a value from an array literal, the omitted element is given an undefined value.

a) omitted value takes “undefined”.

2 Likes

The omitted value takes “undefined”

2 Likes

since no value is present ie one value is missingso undefined

2 Likes

a
a) The omitted value takes “undefined”

1 Like