Statements and declarations

Labeled statement

Try the free JavaScript compiler

Associates an identifier with an enclosing statement so a labeled break can target it. Labeled continue requires a loop target. Labels are not variable bindings.

Formal Syntax & Structure

javascript syntaxjavascript
label: statement

Working Example

Example Snippetjavascript
outer: for (let i = 0; i < 2; i++) { for (let j = 0; j < 2; j++) { console.log(i,j); break outer; } }
JavaScript Reference