3 ms·
Sorry, I misunderstood which isNaN you were talking about. The global isNaN has unexpected behavior in certain edge cases[1], so that's probably why the library
by Ajedi32 5y ago
Sorry, I misunderstood which isNaN you were talking about. The global isNaN has unexpected behavior in certain edge cases[1], so that's probably why the library author chose to avoid it. Number.isNaN doesn't have that behavior, but is not supported in IE.
I agree most people these days should just use Number.isNaN, assuming they don't need to support IE.
[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#confusing_special-case_behavior https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...