javascript loop types code example
Example 1: javascript for loop
var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
Example 2: loop types
1-For (for each)
2-While Loop
3-Do-While loop
var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) {
console.log(colors[i]);
}
1-For (for each)
2-While Loop
3-Do-While loop