How to create an array in JavaScript?

In JavaScript, arrays is used to store multiple values within a single variable at a time.

Syntax for creating Arrays in JavaScript:

var arrayName = [value1, value2, value3];


var name = [‘best’,’interview’,’questions’];

We can access these values with:

var name1 = name[0]; console.log(name1); // it with display best.

Suggest An Answer

No suggestions avaliable!

Related Interview Questions