javascrip loop 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 javascript
for(let i = 1; i > 0; i++) {
}
Example 3: javascript loop if statement
for (let i = 0; i < 10000; i++) {
console.log('huduiduin 100000 times');
}
Example 4: javascript for loop 5 times
for (let step = 0; step < 5; step++) {
console.log('Walking east one step');
}
Example 5: javascript for loop
for (let rep = 1; rep <= 10; rep++) {
console.log(`Lifting weights repetition ${rep}`);
}