TLDR Dev · ARTICLES & TUTORIALS

NAN, THE NOT-A-NUMBER NUMBER THAT ISN'T NAN

piccalil.li9 min read

Summary from the TLDR Dev newsletter

`NaN` results from mathematical operations involving non-numeric values and propagates through calculations. It is unique because `NaN` is not equal to itself, which prevents it from corrupting calculations as an error state. The global `isNaN()` function coerces values to numbers, while `Number.isNaN()` strictly checks for the `NaN` value.