Haha, well it's more like each NaN has a different value under the hood, so technically they're not equal to each other.
Fun fact: since most of the bits in NaN encoding aren't used to store any meaningful information, they can be manipulated to store actual data - payload. This is called NaN-tagging or NaN-boxing and is mostly used for adding additional type encodings to values. Here's one interesting article about it.
c/o "You Don't Know JS"
github.com/getify/You-Dont-Know-JS...
Despite the (condescending) name, the YDKJS series is actually really great.
did the interpreter work like this.
if (token[0] == 'NaN') return false;
return token[0] == token[1];
just kidding
Haha, well it's more like each NaN has a different value under the hood, so technically they're not equal to each other.
Fun fact: since most of the bits in NaN encoding aren't used to store any meaningful information, they can be manipulated to store actual data - payload. This is called NaN-tagging or NaN-boxing and is mostly used for adding additional type encodings to values. Here's one interesting article about it.
wow thank you, never thought about that