Loading…

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];

Example:

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!

Latest post from Javascript interview questions

Ask Question