break vs continue Concept
Question
What is the difference between `break` and `continue` in a loop?
Hint
One stops the loop, the other skips ahead.
Explanation
break immediately terminates the loop — no more iterations run. continue skips the rest of the current iteration and jumps to the next iteration's condition check. Use break when you want to stop early (e.g., found what you're looking for), and continue when you want to skip certain iterations but keep looping.
Related Resources
Related Lessons
- Loops
Learn about break and continue.
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.