3 ms·
no, isNaN has been in the language for quite a while, num !== num has been in the language forever. which actually if I look at number-is-nan it returns retur
by bryanrasmussen 7y ago
no, isNaN has been in the language for quite a while, num !== num has been in the language forever.
which actually if I look at number-is-nan it returns
return typeof value === 'number' && value !== value;
I never use the typeof value === 'number' myself because I always know if what I'm checking is NaN should be a number of not, but probably that's a bad habit to get into.