es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
20 lines (19 loc) • 470 B
JavaScript
const require_isNumber = require("./isNumber.js");
//#region src/compat/predicate/isNaN.ts
/**
* Checks if the value is NaN.
*
* @param value - The value to check.
* @returns `true` if the value is NaN, `false` otherwise.
*
* @example
* isNaN(NaN); // true
* isNaN(0); // false
* isNaN('NaN'); // false
* isNaN(undefined); // false
*/
function isNaN(value) {
return require_isNumber.isNumber(value) && Number.isNaN(Number(value));
}
//#endregion
exports.isNaN = isNaN;