moltres-utils
Version:
Utils for Moltres apps
43 lines (38 loc) • 1.12 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _isNumber = _interopRequireDefault(require("./isNumber"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @since 0.1.0
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* isNaN(NaN)
* // => true
*
* isNaN(new Number(NaN))
* // => true
*
* isNaN(undefined)
* // => false
*/
const isNaN = value => {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return (0, _isNumber.default)(value) && value != +value;
};
var _default = isNaN;
exports.default = _default;
//# sourceMappingURL=isNaN.js.map
;