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
50 lines (43 loc) · 1.06 KB
/
app.js
File metadata and controls
50 lines (43 loc) · 1.06 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
console.log("Hello World!\n==========\n");
console.log(
"Follow the steps in the README.md file to complete the exercises:\n==========\n"
);
// Exercise 1
const a = 20;
const b = 40;
const add = a + b;
const minus = b - a;
const multiply = a * b;
const dividing = b / a;
console.log('Adding:', add);
console.log('Subtracting:', minus);
console.log('Multiplying:', multiply);
console.log('Dividing:', dividing);
// Exercise 2
let a = 11;
let str = "11";
let str2 = "eleven";
let isPresent = true;
let firstName = "Jackie";
let lastName = "Chan";
console.log(a + str);
console.log(a + str2);
console.log(a + isPresent);
console.log(a + firstName);
console.log(a + lastName);
// Exercise 3
let d = 5;
let str3 = "5";
let str4 = "five";
let isPresent2 = false;
let firstName2 = "Robin";
let lastName2 = "Williams";
console.log(d == str3);
console.log(d === str3);
console.log(!isPresent2);
console.log("eleven" == str4 && d >= str3);
console.log(!isPresent2 || isPresent2);
console.log(0 == false);
console.log(0 === false);
console.log(0 != false);
console.log(0 !== false);