We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2602c5f commit 444e5bcCopy full SHA for 444e5bc
01_Basic/04_Comparison.js
@@ -5,5 +5,21 @@
5
// console.log(2!=1);
6
7
8
-console.log("2" > 1);
9
-console.log("02" > 1);
+// console.log("2" > 1);
+// console.log("02" > 1);
10
+
11
+// console.log(null >0) //false
12
+// console.log(null == 0) //false
13
+// console.log(null >= 0) //true
14
15
+// The reason is that an equality check == and comparisons > < >= <= work differently.
16
+// Comparions convert null to a number, treating it as 0
17
+// That's why (3) null >=0 is true and (1) null >0 is false.
18
19
+console.log(undefined ==0) //flase
20
+console.log(undefined >0) //false
21
+console.log(undefined <0) //false
22
23
+// === =>strict check
24
25
+console.log("2" === 2)
0 commit comments