Code, Creativity & Community

Showing posts tagged NaN · View all posts

Discover why NaN !== NaN in JavaScript. Learn about NaN behavior, proper ways to check for NaN, and the difference between isNaN() and Number.isNaN().
NaN (Not-a-Number) is JavaScript's representation of undefined numeric results. The quirk: NaN doesn't equal itself. NaN !== NaN returns true, violating the expectation that values equal themselves. Understanding NaN behavior... Read more...