a statement that does something repeatedly.
Last updated 2 years ago
Was this helpful?
⟩ ⟩ loop
(statement) does something repeatedly.
continue : skips to the next iteration of the current/ loop.
break:breaks the current loop / switch or statement entirely
👉 continue vs. break
(nested loop)
statement is needed
when you want to to the next iteration of an outer loop that is not the nearest enclosing loop.
when you want to break out of a statement that is not the nearest enclosing loop / switch.
break/continue won't operate across an IIFE function boundary to control an outer loop/block.
📗
loops
while / do...while
for loops: for / for-of / for-in / for-await
iteration