We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the informative article! I ran the code in my Chrome console and found a difference. 1 + undefined evaluated to NaN. It looks like undefined does not get coerced to 0.
Yup you are correct! Thank you for letting me know the mistake. I checked in chrome as well as node, both of them do evaluate it to NaN. 😄
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for the informative article! I ran the code in my Chrome console and found a difference.
1 + undefined evaluated to NaN. It looks like undefined does not get coerced to 0.
Yup you are correct! Thank you for letting me know the mistake. I checked in chrome as well as node, both of them do evaluate it to NaN. 😄