Loops and Ranges
Counting For Loops
Run a loop a fixed number of times.
Counting For Loops
counting_for.js
const limit = 4;
let total = 0;
for (let i = 1; i <= limit; i += 1) {
total += i;
}
console.log("limit=" + limit);
console.log("total=" + total);
counting-for
A counting `for` loop has an initializer, a condition, and an update. Each pass through the loop is one iteration.