Statements and declarations

default clause

Try the free JavaScript compiler

Optional switch clause selected when no case matches. It can occur before or after other cases, and its body can also be reached by fallthrough. Only one default is allowed.

Formal Syntax & Structure

javascript syntaxjavascript
default: statements

Working Example

Example Snippetjavascript
switch (9) { case 1: break; default: console.log("other"); }
JavaScript Reference