4 ms·
Yeah, but the thing is that it's just unnecessary. isNaN() has been in the language forever. And in case you really need Number.isNaN() (because it's weird for
by epidemian 6y ago
Yeah, but the thing is that it's just unnecessary.
isNaN() has been in the language forever. And in case you really need Number.isNaN() (because it's weird for isNaN('foo') to be true), it's been there for quite a long time too. Not enough to be on IE, sadly, but certainly more than enough to be on the modern JS engines React Native runs on.
So, at least for React Native, the package number-is-nan shouldn't be necessary at all. But it's probably a transitive dependency, and that's basically the problem with all these sort of polyfill packages: you might not need them, but a library that runs on older engines on which you depend (directly or transitively) does need them, so you end up paying the price anyway.
- deleted 6y ago[deleted]
- bryanrasmussen 6y agono, 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.