Java script 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: js array
let numbers = [ 11 , 13 , 15 , 17]
for(let i = 0;i<numbers.length;i++) {
console.log(numbers[i])
}
Example 3: array ub js
var fruits = ['Apple', 'Banana'];
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: javascript array
const arr = [1, 2, 3];
Example 6: array javascript
var familly = [];
var familly = new Array()
var familly = [Talel, Wafa, Eline, True, 4];
console.log(familly[0])
familly[0] + "<3" + familly[1]
familly[3] = "Amir";