Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
joelbirchler
· 12y ago · 0 comments
The + operation is evaluated first, and + coerces nulls to zeros. This looks like:
(null + null) === 0
(0) === 0
true
Comments
[–]
swozniak
12y ago
Ah, it looks like JavaScript coerces null to the type against which it is being compared.
Thanks!