I recently thought about defining a function to copy the functionality of isNaN out of boredom when I found out, that Number(undefined)
equals NaN</code>, but if you do
Number(undefined) === NaNyou get
false`.
I even tried (typeof Number(undefined)) === (typeof NaN)
which returns true
.
What is JavaScript doing here?