Vidyalelo
JavaScript · Q1

Array And Function

Programming · JavaScript · question 1

Q1

Consider the code snippet given below var count = [1,,3]; What is the observation made?

A.
The omitted value takes “undefined”
Answer
B.
This results in an error
C.
This results in an exception
D.
None of the mentioned

Answer: Option A

Solution

Answer: Option A
Solution:
If you omit a value from an array literal, the omitted element is given the value.