3 comments

[ 3.3 ms ] story [ 27.9 ms ] thread
What? `NaN` isn't some primitive constant like `true`, `false`, `null` or `undefined`? It _actually_ is a number?
Yes! Since any function returning a float might need to return NaN, NaNs are represented as a special kind of float, with most bits unused.
Cool. Is that why NaN isn't equal to anything? Not even when comparing a NaN variable to itself? (I assume it's because you can't have some NaN values be equal, and others not)