-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment27.ts
36 lines (33 loc) · 923 Bytes
/
assignment27.ts
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
// 1st Version
var alien_color = "green";
if (alien_color === "green") {
console.log("Congrats ! You just earned 5 points");
}
if (alien_color === "red") {
console.log("Congrats ! You just earned 15 points");
}
if (alien_color === "yellow") {
console.log("Congrats ! You just earned 10 points");
}
// 2nd Version
var alien_color2 = "red";
if (alien_color2 === "green") {
console.log("Congrats ! You just earned 5 points");
}
if (alien_color2 === "red") {
console.log("Congrats ! You just earned 15 points");
}
if (alien_color2 === "yellow") {
console.log("Congrats ! You just earned 10 points");
}
// 3rd Version
var alien_color3 = "yellow";
if (alien_color3 === "green") {
console.log("Congrats ! You just earned 5 points");
}
if (alien_color3 === "red") {
console.log("Congrats ! You just earned 15 points");
}
if (alien_color3 === "yellow") {
console.log("Congrats ! You just earned 10 points");
}