-
Notifications
You must be signed in to change notification settings - Fork 0
/
learnswitch.js
55 lines (44 loc) · 1.14 KB
/
learnswitch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// const color= "red"
// switch (color){
// case "red":
// console.log('color is red')
// break
// case "blue":
// console.log('color is blue')
// break
// case "Yellow":
// console.log('color is Yellow')
// break
// }
// if (score>=70){
// console.log('Distinction')
// } else if (score>=60 && score<70){
// console.log('Very good')
// } else if (score>=50 && score<60){
// console.log('Good')
// } else if (score>=40 && score<50){
// console.log('Pass') }
// else {
// console.log('fail')
// }
const score = 80
switch (true){
case score>=70:
console.log('Distinction')
break;
case ((score>=60) && (score<70)):
console.log('Very Good')
break;
case ((score>=50) && (score<60)):
console.log('Good')
break;
case ((score>=40) && (score<50)):
console.log('pass')
break;
case ((score>=30) && (score<40)):
console.log('fail')
break;
default:
console.log('failed')
break;
}