1 var isNumber = require('./isNumber');
4 * Checks if `value` is `NaN`.
6 * **Note:** This method is based on
7 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
8 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
9 * `undefined` and other non-number values.
15 * @param {*} value The value to check.
16 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
22 * _.isNaN(new Number(NaN));
31 function isNaN(value) {
32 // An `NaN` primitive is the only value that is not equal to itself.
33 // Perform the `toStringTag` check first to avoid errors with some
34 // ActiveX objects in IE.
35 return isNumber(value) && value != +value;
38 module.exports = isNaN;