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.
BY Best Interview Question ON 25 Aug 2022