Re:WTFJS – a list of funny and tricky JavaScript examples
by fmihaila on Monday July 31, 2017 @10:54AM
(#14892532)
NaN is not a name for one thing. You could think of not a number as not any particular thing. There is no comparison with itself, because there is no it.
[ Parent
| on HN ]
Re:WTFJS – a list of funny and tricky JavaScript examples
by goatlover on Monday July 31, 2017 @11:02AM
(#14892625)
How is isNaN() implemented?
Re:WTFJS – a list of funny and tricky JavaScript examples
by Gaelan on Monday July 31, 2017 @11:21AM
(#14892804)
function isNaN(x) { return x !== x }
It’s a native browser function so it may not actually be done that way, but that’s one way you could do it.
Re:WTFJS – a list of funny and tricky JavaScript examples
by tambourine_man on Monday July 31, 2017 @11:37AM
(#14892940)
We really are deep in the realm of Philosophy.