how to create a javascript array code example
Example 1: javascript array
var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
Example 2: how to make an array in javascript
var names = ["Sanjith", "Pranav", "Aadya", "Saharsh"]
Example 3: javascript to array
Array.from("Hello");
Example 4: array
const MyArray = {"Object1", "Object2", "Object3"};
Example 5: access index of array javascript
let first = fruits[0]
let last = fruits[fruits.length - 1]