-
Notifications
You must be signed in to change notification settings - Fork 0
/
011-If-else-statement.js
31 lines (27 loc) · 1.05 KB
/
011-If-else-statement.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
/*
* Author : Jaydatt Patel
if else conditional statements
*/
console.log('(100 == "100") : ' + (100 == "100"));
console.log('(100 === "100") : ' + (100 === "100")); //compare and check data type also same or not
console.log("(100 === 100) : " + (100 === 100)); //compare and check data type also same or not
console.log('(100 != "100") : ' + (100 != "100"));
console.log('(100 !== "100") : ' + (100 !== "100")); //compare and check data type also same or not
console.log("(100 !== 100) : " + (100 !== 100)); //compare and check data type also same or not
var A = 5;
var B = 10;
var C = 2;
if (A > B && A > C) {
console.log("A is largest");
} else if (B > A && B > C) {
console.log("B is largest");
} else if (C > A && C > B) {
console.log("C is largest");
} else {
console.log("All are Same");
}
var light = "orange";
if (light == "green") console.log("Drive");
else if (light == "orange") console.log("Get ready");
else if (light == "red") console.log("Dont' drive");
else console.log("The light is not green, orange, or red");