-
Notifications
You must be signed in to change notification settings - Fork 0
/
0.04_booleans.js
81 lines (73 loc) · 1.85 KB
/
0.04_booleans.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//booleans express either
//true or false
//on or off
var tired = false;
var hungry = true;
// = assigns information into a variable
// == compares value is equal true? (returns true or false)
// === evaluates both value and type of variable
var isTrue = 1 == "1";
var compare = "3" === 3;
//console.log(compare);
/*
Operator Meaning
= Equality
== Equality
=== Strict equality
!= Inequality
!== Strict inequality
> greater than
< lesser than
>= Greater than or equal
<= Less than or equal
*/
/*
var num1 = 35;
var num2 = "35";
console.log(num1 !== num2);
var foo = true;
console.log(!foo);
*/
/*CHALLENGE: Gold
I want to order some Colts gear online(Jona, go ahead with the Bengals(boo)), and I'm not sure
which courier service to use yet. I want to know which one to use
for Next Day Air, 2 day air, 3 day ground, and whenever. Can you write
an if/else statement that helps me pick the best one? It's just your opinion here.
*/
var orColtsGe = false
var orBenGe = true
var nexDayAir = 1
var twoDayAir = 2
var threDayAir = 3
if (orColtsGe == true && orBenGe == true) {
if (nexDayAir === 1){
console.log("Gear will be here tomorrow!");
}
else if (twoDayAir === 2) {
console.log("Gear will be in in two days");
} else {
console.log("Gear will be here in three days");
}
}
else if (orColtsGe == true && orBenGe == false){
if (nexDayAir === 1) {
console.log("You get Colts tomorrow");
}
else if (twoDayAir === 2) {
console.log("You get Colts in two days");
} else {
console.log("Colts gear in three days");
}
}
else if (orColtsGe == false && orBenGe == true){
if (nexDayAir === 1) {
console.log("You get Bengals tomorrow");
}
else if (twoDayAir === 2) {
console.log("You get Bengals in two days");
} else {
console.log("Bengals gear in three days");
}
} else {
console.log("Nothing coming in the mail, sorry");
}