forked from truecodersio/JavaScript_Variables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.js
More file actions
49 lines (41 loc) · 1.21 KB
/
operators.js
File metadata and controls
49 lines (41 loc) · 1.21 KB
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
// JS Operators Exercise
//Exercise 1
let a = 20;
let b = 4;
let add = a + b;
let minus = a - b;
let multiply = a * b;
let dividing = a / b;
console.log(`${add}\n${minus}\n${multiply}\n${dividing}`)
//Exercise 2
let a = 11;
let str = "11";
let str2 = "eleven";
let isPresent = true;
let firstName = "Jackie";
let lastName = "Chan";
/*
What is the value of: a + str? ANSWER = "1111"
What is the value of: a + str2? ANSWER = "11eleven"
What is the value of: a + isPresent? ANSWER = 12
What is the value of: a + firstName? ANSWER = "11Jackie"
What is the value of: a + lastName? ANSWER = "11Chan"
*/
//Exercise 3
let d = 5;
let str3 = "5";
let str4 = "five";
let isPresent2 = false;
let firstName2 = "Robin";
let lastName2 = "Williams";
/*
What is the value of: d == str3? ANSWER = true
What is the value of: d === str3? ANSWER = false
What is the value of: !isPresent2? ANSWER = true
What is the value of: (“eleven” == str4 && d >= str3)? ANSWER = false
What is the value of: (!isPresent2 || isPresent2)? ANSWER = true
What is the value of: 0 == false? ANSWER = true
What is the value of: 0 === false? ANSWER = false
What is the value of: 0 != false? ANSWER = false
What is the value of 0 !== false? ANSWER = true
*/