js switch case
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
js switch case
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
javascript switch statement multiple cases
//javascript multiple case switch statement
var color = "yellow";
var darkOrLight="";
switch(color) {
case "yellow":case "pink":case "orange":
darkOrLight = "Light";
break;
case "blue":case "purple":case "brown":
darkOrLight = "Dark";
break;
default:
darkOrLight = "Unknown";
}
//darkOrLight="Light"
javascript multiple cases
switch (varName)
{
case "afshin":
case "saeed":
case "larry":
alert('Hey');
break;
default:
alert('Default case');
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us