1let day : number = 4;
2
3switch (day) {
4 case 0:
5 console.log("It is a Sunday.");
6 break;
7 case 1:
8 console.log("It is a Monday.");
9 break;
10 case 2:
11 console.log("It is a Tuesday.");
12 break;
13 case 3:
14 console.log("It is a Wednesday.");
15 break;
16 case 4:
17 console.log("It is a Thursday.");
18 break;
19 case 5:
20 console.log("It is a Friday.");
21 break;
22 case 6:
23 console.log("It is a Saturday.");
24 break;
25 default:
26 console.log("No such day exists!");
27 break;
28}
1switch(expression) {
2 case constant-expression1: {
3 //statements;
4 break;
5 }
6 case constant_expression2: {
7 //statements;
8 break;
9 }
10 default: {
11 //statements;
12 break;
13 }
14}
15