Loop Counter

noun

say it: “LOOP KOWN-ter” /luːp ˈkaʊntər/

The variable a loop uses to count its passes, such as lap in for (let lap = 1; lap <= 3; lap++).

What is Loop Counter in JavaScript?

Loop Counter — The variable a loop uses to keep count of its passes, often named i. A for loop gives it a starting value, a condition to keep going, and a step that changes it each time around.

for (let lap = 1; lap <= 3; lap++) {
  console.log(`Lap ${lap}`); // Lap 1, then Lap 2, then Lap 3
}

In a sentence

  • “The loop counter round went from 1 to 5, so the game printed five rounds.”

Level: Novice · More JavaScript terms at this level

Updated

In other subjects