Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
3picName7297yMaybe it inverts the >= operator to <. And null < 0 is false. Inverting it again gives null >= 0 to be true. Just a guess, don't know any JS.
-
@devnulli How can the numerical value null gets converted into be larger and equal to zero but not larger or equal to 0
-
@devnulli
null == 0 // false
null > 0 // false
null >= 0 // true
Is logically impossible, that's the problem -
@devnulli Well yes, it's physically possible else it wouldn't be happening. That doesn't mean that it doesn't violate the universally accepted definition of "greater than or equal to". It's extremely bad language design because it's unpredictable and inconsistent
-
@devnulli I know. That makes it even worse because the equality operator might aswell coerce null into a number
Related Rants
Typical JS
null > 0 //false
null == 0 //false
null >= 0 //true
Wtf?
undefined
wtf
sryforpic
js
wtfisthis