adplus-dvertising
frame-decoration

Question

What is the correct syntax to create an array in java script?

a.

Names = new Array(“tom”‚ “jerry”);

b.

Names = new Array(1 : “tom”, 2 : “jerry”);

c.

Names = new Array { “tom”, “jerry” };

d.

Names = new Array [ “tom”, “jerry” ];

Answer: (a).Names = new Array(“tom”‚ “jerry”);

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the correct syntax to create an array in java script?