Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript switch

let x = 3;

switch(x) {
  case 1:
    console.log("You entered 1");
    break;
  case 2:
    console.log("You entered 2");
    break;
  default:
    console.log("You entered: "+ x);
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #switch
ADD COMMENT
Topic
Name
4+7 =