switch statement
//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"int x = Random.Range(0, 5);
switch(x){
case 0:
//preform action if x=0
break;
case 1:
//preform action if x=1
break;
//CONTINUE DOWN
}switch (varName)
{
case "afshin":
case "saeed":
case "larry":
alert('Hey');
break;
default:
alert('Default case');
}switch (a) {
case 1:
alert('case 1 executed');
break;
case 2:
alert("case 2 executed");
break;
case 3:
alert("case 3 executed");
break;
case 4:
alert("case 4 executed");
break;
default:
alert("default case executed");
}switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
Also in C#:
- c# making a folder
- how to turn a string in a char list c#
- change textbox location C#
- unity detect any key
- asp.net core task iactionresult
- viewBag as a list
- rotate object towards target rotation slowly unity
- uncaught syntaxerror invalid or unexpected token unity webgl
- reverse a string in c#
- c# length of array
- c# lambda expression
- how to flip selection in aseprite
- check if two timespans intersect c#
- c# inheritance constructor
- vector between two points unity
- page refresh on button click in c#
- c# get index of item in list
- set decimal point c#
- what is using static in c#
- ihttpactionresult to object c#
- unity rigid body variable
- how to change scenes in unity
- unity html get request
- switch case c# contains