1//javascript multiple case switch statement
2var color = "yellow";
3var darkOrLight="";
4switch(color) {
5 case "yellow":case "pink":case "orange":
6 darkOrLight = "Light";
7 break;
8 case "blue":case "purple":case "brown":
9 darkOrLight = "Dark";
10 break;
11 default:
12 darkOrLight = "Unknown";
13}
14
15//darkOrLight="Light"
1switch (varName)
2{
3 case "afshin":
4 case "saeed":
5 case "larry":
6 alert('Hey');
7 break;
8
9 default:
10 alert('Default case');
11}
1var color = "yellow";
2var darkOrLight="";
3switch(color) {
4 case "yellow":case "pink":case "orange":
5 darkOrLight = "Light";
6 break;
7 case "blue":case "purple":case "brown":
8 darkOrLight = "Dark";
9 break;
10 default:
11 darkOrLight = "Unknown";
12}
13
14//darkOrLight="Light"