skips to the next iteration of the current/labeled loop.
Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ continue
(statement) skip to the next iteration of the current / loop.
continue; // skips to next iteration of current loop continue label; // skips to next iteration of labeled loop
continue statement can be used only within the body of a loop, using it anywhere else causes a .
nested loop
statement is needed when you want to skip to the next iteration of an outer loop that is not the nearest enclosing loop.
break/continue won't operate across an IIFE function boundary to control an outer loop/block.
📗
label is only used by break / continue.
if the code you need to wrap a scope around has return, this, break, or continue in it, don't use a function/IIFE(which has its own function boundary), use a block instead❗️
continue vs. break
iteration
label statement
⟩ ⟩ ⭐️
⟩