DEV Community

Discussion on: Coercion in JavaScript

techdebtor profile image

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.

godcrampy profile image
Sahil Bondre Author

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. 😄