for Loop Iteration Count
Multiple Choice Easy
Question
How many times does `for (let i = 0; i < 5; i++)` run the loop body?
Hint
i goes 0, 1, 2, 3, 4 — count them.
Explanation
i starts at 0 and increments by 1 each iteration. The loop runs while i < 5, so i takes values 0, 1, 2, 3, 4 — that is 5 iterations. The loop exits when i reaches 5, which fails the condition.
Related Resources
Related Lessons
- Loops (for & while)
Learn how for and while loops work.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.