ar.js 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: js array
let numbers = [ 11 , 13 , 15 , 17]
for(let i = 0;i<numbers.length;i++) {
console.log(numbers[i])
}
Example 3: js array
const users = ["Mark", "Greg"];
Example 4: js array
var colors = [ "red", "orange", "yellow", "green", "blue" ];
console.log(colors);
console.log(colors[0]);
console.log(colors[1]);
console.log(colors[4]);
colors[4] = "dark blue"
console.log(colors[4]);
Example 5: array
const MyArray = {"Object1", "Object2", "Object3"};