use map with switch case javascript code example
Example 1: js switch case
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
Example 2: c# switch case with or condition
int i = 5;
switch (i)
{
case(1):
case(2):
Console.WriteLine(i);
break;
default:
break;
}
Example 3: multiple case switch javascript
switch (varName)
{
case "afshin":
case "saeed":
case "larry":
alert('Hey');
break;
default:
alert('Default case');
}