2 ms·
The language-agnostic way to check for NaN is to check whether x != x. Some languages might also need a type check, but AFAIK JS isn't one of them.
by simonster 14y ago
The language-agnostic way to check for NaN is to check whether x != x. Some languages might also need a type check, but AFAIK JS isn't one of them.