JAVASCRIPT CLIMBSChapter 3 · JS Collections & Loops
Repeating code
In JavaScript, you can repeat code using a for loop. The loop initialization, condition, and increment go inside parentheses, separated by semicolons.
Worked example
How it reads
let i = 0initializes a counter variable at 0.i < 3keeps looping as long as the counter is less than 3.i++adds 1 to the counter at the end of each turn.

Cloud tip: You can also loop over arrays using the modern
for (const item of array) syntax.

