for Loop
noun
say it: “FOR loop” /fɔːr luːp/
A JavaScript loop with a counter: it sets the counter, checks a condition before each round, and updates the counter after each round, often to visit an array's items by index.
What is for Loop in JavaScript?
for Loop — Repeats code once for each item in a collection.
for (let day = 0; day < 3; day++) {
scheduled[day] = true;
}
In a sentence
- “My for loop printed table numbers 1 to 10 for the cafe's seating chart.”
- “My for loop counted from 0 up to the playlist's length and printed each song with its number.”
Level: Apprentice · More JavaScript terms at this level
Updated