new for loop javascript code example
Example 1: how to make a javascript for loop
var tops = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144];
for (let i = 0; i < tops.length; i++) {
document.write(tops[i] + "tops");
}
Example 2: how to do a for loop in js
for (let i = 0; i < 10; i++) {
console.log(i);
}