Skip to content

Commit 39048cf

Browse files
authored
Merge pull request #139 from herambgadekar/patch-1
Update article.md
2 parents fa4a678 + 32352a1 commit 39048cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/02-first-steps/08-comparison/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ alert( null == 0 ); // (2) false
174174
alert( null >= 0 ); // (3) *!*true*/!*
175175
```
176176

177-
Yeah, mathematically that's strange. The last result states that "`null` is greater than or equal to zero". Then one of the comparisons above must be correct, but they are both falsy.
177+
Yeah, mathematically that's strange. The last result states that "`null` is greater than or equal to zero". Then one of the comparisons above must be correct, but they are both false.
178178

179179
The reason is that an equality check `==` and comparisons `> < >= <=` work differently. Comparisons convert `null` to a number, hence treat it as `0`. That's why (3) `null >= 0` is true and (1) `null > 0` is false.
180180

0 commit comments

Comments
 (0)