how to create a for loop in javascript code example
Example 1: javascript loop through array
var myStringArray = ["Hello","World"];
var arrayLength = myStringArray.length;
for (var i = 0; i < arrayLength; i++) {
console.log(myStringArray[i]);
//Do something
}
Example 2: for loop javascript
var i;
for (i = 0; i < 10 ; i++) {
//do something
}