forked from truecodersio/JavaScript_Operators
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
54 lines (44 loc) · 1.19 KB
/
app.js
File metadata and controls
54 lines (44 loc) · 1.19 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
50
51
52
53
console.log("Hello World!\n==========\n");
console.log(
"Follow the steps in the README.md file to complete the exercises:\n==========\n"
);
// Exercise 1
console.log("EXERCISE 1:\n==========\n");
let a = 20;
let b = 4;
let sum = a + b;
let multiply = a * b;
let divid = a / b;
let remainder = a % b;
console.log(sum);
console.log(multiply);
console.log(divid);
console.log(remainder);
// Exercise 2
console.log("EXERCISE 2:\n==========\n");
let num = 11;
let str = "11";
let str2 = "eleven";
let isPresent = true;
let firstName = "Frodo";
let lastName = "Baggins";
let value1 = num + str;
let value2 = num + str2;
let value3 = num + isPresent;
let value4 = firstName + num;
let value5 = isPresent + str;
let value6 = firstName + lastName;
console.log(value6 + " " + value1 + " " + value2 + " " + value3 + " " + value4 + " " + value5);
// Exercise 3
console.log("EXERCISE 3:\n==========\n");
let val = 5;
let str3 = "5";
let str4 = "five";
let isPresent2 = false;
console.log(val == str3); //true
console.log(!isPresent2); //true
console.log(!isPresent2 || isPresent2); //true
console.log(0 == false); //true
console.log(0 === false); //false
console.log(0 != false); //false
console.log(0 !== false); //true