Packages

A web application in pursuit of meaning in life.

Retired package: Complete rewrite, scratch old versions

Current section

Files

Jump to
udia assets node_modules mout src lang isNaN.js
Raw

assets/node_modules/mout/src/lang/isNaN.js

define(['./isNumber', '../number/isNaN'], function (isNumber, $isNaN) {
/**
* Check if value is NaN for realz
*/
function isNaN(val){
// based on the fact that NaN !== NaN
// need to check if it's a number to avoid conflicts with host objects
// also need to coerce ToNumber to avoid edge case `new Number(NaN)`
return !isNumber(val) || $isNaN(Number(val));
}
return isNaN;
});