Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "unlabeled break must be inside loop or switch" occurs when a break statement is not inside a loop or a switch statement.

Reference entryJavaScriptFetched
SyntaxError: Illegal break statement (V8-based)
As listed by MDN Web Docs
SyntaxError: unlabeled break must be inside loop or switch (Firefox)
As listed by MDN Web Docs
SyntaxError: 'break' is only valid inside a switch or loop statement. (Safari)
As listed by MDN Web Docs
Category
SyntaxError
Severity
error
Runtime
both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: MDN Web Docs. Data fetched 2026-09-25T01:48:37.272Z.