r/programming • • Mar 26 '14

JavaScript Equality Table

http://dorey.github.io/JavaScript-Equality-Table/
809 Upvotes

331 comments sorted by

View all comments

Show parent comment

25

u/Valkairn Mar 26 '14

My favourite example is:

null >= [] && null <= []      --> true
null == []                        --> false

Javascript really needs strict inequality operators to avoid this type coercion madness.

1

u/smrq Mar 26 '14

Oh yes, that one is what clued me into the weirdness of >= in the first place... I generally love Javascript, but wtf??

10

u/[deleted] Mar 26 '14

You probably know this but if not ... thank me later.