syntax for loop javascript code example
Example 1: javascript loop through array
var colors = ["red","blue","green"];
colors.forEach(function(color) {
console.log(color);
});
Example 2: javascript for loop
var i;
for (i = 0; i < 10 ; i++) {
//do something
}