switch
Description
The switch of Statements for JS executes code when a condition matches a case.
break ends the switch.
default executes when no case is a match.
Syntax
switch(condition) { case 1: code break; case 2: code break; ... default: code }
The switch of Statements for JS executes code when a condition matches a case.
break ends the switch.
default executes when no case is a match.
switch(condition) { case 1: code break; case 2: code break; ... default: code }