array in array js code example
Example 1: javascript element in array
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var n = fruits.includes("Mango");
Example 2: javascript array
var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
Example 3: array of objects javascript
var widgetTemplats = [
{
name: 'compass',
LocX: 35,
LocY: 312
},
{
name: 'another',
LocX: 52,
LocY: 32
}
]
Example 4: javascript to array
Array.from("Hello");
Example 5: javacript array
[element0, element1, ..., elementN]
new Array(element0, element1[, ...[, elementN]])
new Array(arrayLength)
Example 6: create array with number js
var foo = new Array(45);