-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestion22.ts
45 lines (29 loc) · 1.5 KB
/
question22.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
37
38
39
40
41
42
43
44
45
// Conditional Tests: Write a series of conditional tests. Print a statement describing each test and your prediction for the results of each test. Your code should look something like this:
// let car = 'subaru';
// console.log("Is car == 'subaru'? I predict True.")
// console.log(car == 'subaru')
// • Look closely at your results, and make sure you understand why each line evaluates to True or False.
// • Create at least 10 tests. Have at least 5 tests evaluate to True and another 5 tests evaluate to False.
let number = 5;
console.log("Is number == 5? I predict True.");
console.log(number == 5); // True
console.log("Is number != 5? I predict False.");
console.log(number != 5); // False
console.log("Is number < 10? I predict True.");
console.log(number < 10); // True
console.log("Is number > 10? I predict False.");
console.log(number > 10); // False
console.log("Is number <= 5? I predict True.");
console.log(number <= 5); // True
console.log("Is number >= 5? I predict True.");
console.log(number >= 5); // True
let booleanValue = true;
console.log("Is booleanValue == true? I predict True.");
console.log(booleanValue == true); // True
console.log("Is booleanValue != true? I predict False.");
console.log(booleanValue != true); // False
let string = 'hello';
console.log("Is string == 'hello'? I predict True.");
console.log(string == 'hello'); // True
console.log("Is string == 'world'? I predict False.");
console.log(string == 'world'); // False