javascript array
//create an array like so:
var colors = ["red","blue","green"];
//you can loop through an array like this:
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
javascript array
//create an array like so:
var colors = ["red","blue","green"];
//you can loop through an array like this:
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
array of objects javascript
var widgetTemplats = [
{
name: 'compass',
LocX: 35,
LocY: 312
},
{
name: 'another',
LocX: 52,
LocY: 32
}
]
how to initialize an array in javascript
var array_name = [item1, item2, ...];
access index of array javascript
let first = fruits[0]
// Apple
let last = fruits[fruits.length - 1]
// Banana
javascript array
//create an array:
let colors = ["red","blue","green"];
//you can loop through an array like this:
//For each color of the Array Colors
for (color of colors){
console.log(color);
}
//or you can loop through an array using the index:
for (var i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
array in js
var array_name = [item1, item2, ...];
//Used to store more than 1 items
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us