for loops java scripts code example
Example 1: javascript for loops
JavaScript For Loop: Summary
There are three types of for loops: the regular for loop, the for/in loop and for/of loop.
The for loop iterates through an array.
The for/in loop iterates through the properties of an object.
The for/of loop iterates through iterable objects, like arrays and strings.
Example 2: js for loops
let i;
for (i = 0; i < 6; ++i) {
console.log("Hello"); // print Hello 6 times
}