Which of the following is the correct way for writing JavaScript array?

Options
- var salaries = new Array( 1:39438, 2:39839 3:83729)
- var salaries = new (Array:1=39438, Array:2=39839, Array:3=83729)
- var salaries = new Array(39438,39839,83729)
- var salaries = new Array() values=39438,39839,83729


CORRECT ANSWER : var salaries = new Array(39438,39839,83729)

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement