Why is JavaScript null being evaluated strangely?

Why was JavaScript running the way it is?

Consider the following example:

null == 0 // false
null >= 0 // true
null > 0  // false

      

+3
javascript


source to share


No one has answered this question yet

See similar questions:

98
Why is `null> = 0 && null <= 0` but not` null == 0`?
23
Javascript comparison question (null> = 0)

or similar:

7649
How does JavaScript blocking work?
7494
How can I remove a specific element from an array in JavaScript?
7432
How to check if a string contains a substring in JavaScript?
7287
What does "use strict" do in JavaScript, and what are the reasons for it?
5670
Which operator is equal (== vs ===) should be used in JavaScript comparisons?
4829
How do I include a JavaScript file in another JavaScript file?
3915
Why does Google add while (1); into your JSON responses?
2288
How can I convert a string to boolean in JavaScript?
1511
Why does ++ [[]] [+ []] + [+ []] return the string "10"?
1077
Does JavaScript have a null coalescing operator?



All Articles
Loading...
X
Show
Funny
Dev
Pics