Language concepts

Switch fallthrough

Try the free JavaScript compiler

After entering a case, execution can continue into the next case body unless control exits. Use deliberate shared labels or document intentional fallthrough.

Formal Syntax & Structure

javascript syntaxjavascript
case a: first; case b: second;

Working Example

Example Snippetjavascript
switch (1) { case 1: console.log("one"); case 2: console.log("two"); break; }
JavaScript Reference