Statements and declarations
case clause
A switch label that is compared with the discriminant using strict equality during case selection. Once execution has begun, subsequent case bodies may execute without their labels matching.
Formal Syntax & Structure
javascript syntaxjavascript
case expression: statementsWorking Example
Example Snippetjavascript
switch (1) { case "1": console.log("text"); break; case 1: console.log("number"); break; }