1 points · by swozniak · 12y ago · 4 comments
typeof null === 'object'
and
typeof 0 === 'number'
Can someone explain?
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
(null + null) === 0
(0) === 0
true
Thanks!
0
> +null
0
Looks like JS converts null to 0 when it's used in a number context.