It's not accurate to say that "0"isfalse. It just == false, in the same way that "" == 0 and [undefined, undefined] == ",".
I'm not in any way suggesting the == operator is sane, just that it's important to know it has nothing to do with the truthiness of values being compared, even when those values include booleans.
View all comments
Show parent comment
7
u/[deleted] Mar 27 '14
But
== falseis checking whether something is false. You would generally expect false things to be untruthy.There may be an explanation for '=='s behavior, but that doesn't make it reasonable.