⤴️break

JSstatementcontrol flow ⟩ break

(statement) exit immediately

break;              // break current loop/switch
break <label>;      // break labeled statement

break statement (with or without a label) can not transfer control across function boundaries. cannot label a function definition statement, for example, and then use that label inside the function.

break / continue won't operate across an IIFE function boundary to control an outer loop/block.

📗 You Don't Know JS Yet: Scopes & Closrues

Last updated