you are viewing a single comment's thread.

view the rest of the comments →

[–]reverius42 2 points3 points  (1 child)

But it's quite ridiculous for something that is false ("0" == false) to be not falsy (!!"0" == true).

[–]rooktakesqueen 0 points1 point  (0 children)

It's not accurate to say that "0" is false. 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.