I could be convinced into thinking == would return true if null was treated as 0 (so 0 + 0 = 0), but with ===, this doesn't seem right at all, especially considering:<p>typeof null === 'object'<p>and<p>typeof 0 === 'number'<p>Can someone explain?
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.<p>You can do the same with false: (false + false === 0)<p>And also (true + true === 2) is true<p>Edit: The same way as if you do "" + 1 you get "1" because it assumes + as string concatenation