- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6_Switch.js
More file actions
Latest commit
22 lines (19 loc) · 531 Bytes
/
Copy path6_Switch.js
File metadata and controls
22 lines (19 loc) · 531 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
Switch Case is an alternative to if-else condition.
incase there are too manu else-if conditions we can put them in a switch case condition
*/
varposition="FiRsT"
// transforms the value of variable 'position' and then compares the result with
switch(position.toLowerCase()){
case"first":
console.log("Gold Medal")
break;
case"second":
console.log("Silver Medal")
break;
case"third":
console.log("Bronze Medal")
break;
default:
break;
}