Re:In JavaScript, why does (null + null === 0) return true?
by singold on Monday May 05, 2014 @01:52PM
(#7700007)
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
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