Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array js

//create an array like so:
var colors = ["red"];

//can add an element to array like this:
colors.push("blue");

//loop through an array like this:
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Source by core-electronics.com.au #
 
PREVIOUS NEXT
Tagged: #array #js
ADD COMMENT
Topic
Name
9+9 =