Hacker News new | ask | show | jobs
by singold 4431 days ago
I don't really know (I don't have that in depth knowledge of javascript) but it is probably like you said, because you are doing a sum, it treats null as 0, so (0 + 0 === 0) is true.

You can do the same with false: (false + false === 0)

And also (true + true === 2) is true

Edit: The same way as if you do "" + 1 you get "1" because it assumes + as string concatenation