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 www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #array #js
ADD COMMENT
Topic
Name
3+5 =