JS: Difference of isNaN vs Number.isNaN
- The global
isNaNconverts the argument to number first. Number.isNaNdoes not.
console.assert(globalThis["isNaN"] === isNaN);
🟢 TIP: use Number.isNaN. Never use the global one.
isNaN converts the argument to number first.Number.isNaN does not.console.assert(globalThis["isNaN"] === isNaN);
🟢 TIP: use Number.isNaN. Never use the global one.