1function whatToDrink(time){
2 var drink ;
3 switch (time) {
4 case "morning":
5 drink = "Tea";
6 break;
7 case "evening":
8 drink = "Shake";
9 break;
10 default:
11 drink="Water";
12 }
13 return drink;
14}
15console.log(whatToDrink("morning")) //Tea
16console.log(whatToDrink("evening")) //Shake
17console.log(whatToDrink("night")) //Water
18console.log(whatToDrink("daytime")) //Water
1int x = Random.Range(0, 5);
2switch(x){
3case 0:
4//preform action if x=0
5break;
6case 1:
7//preform action if x=1
8break;
9//CONTINUE DOWN
10}