JS LOOPSChapter 3 · JS Collections & Loops
Break and Continue
Inside any loop, continue skips the rest of the current pass and moves on to the next one, and break leaves the loop completely. They keep loops simple: skip what you do not care about, and stop as soon as you have your answer.
Worked example
How it reads
continueskips even numbers without stopping the loopbreakends the loop entirely once n passes 7- Both work in
for,for...ofandwhileloops

Cloud tip: Searching for the first match?
break as soon as you find it and skip the rest of the work.

