diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 38a296544..bf7f77431 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -625,6 +625,10 @@ result = _.isFinite(Infinity); result = _.isFunction(_); +result = _.isNaN(NaN); +result = _.isNaN(new Number(NaN)); +result = _.isNaN(undefined); + var mergeNames = { 'stooges': [ { 'name': 'moe' }, diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index fd771b1ce..7b6792b45 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2433,6 +2433,16 @@ declare module _ { **/ export function isFunction(value: any): boolean; + /** + * Checks if value is NaN. + * + * Note: This is not the same as native isNaN which will return true for undefined and other + * non-numeric values. See http://es5.github.io/#x15.1.2.4. + * @param value The value to check. + * @return True if the value is NaN, else false. + **/ + export function isNaN(value: any): boolean; + /** * Recursively merges own enumerable properties of the source object(s), that don't resolve * to undefined into the destination object. Subsequent sources will overwrite property @@ -2681,15 +2691,6 @@ declare module _ { **/ export function isRegExp(object: any): boolean; - /** - * Returns true if object is NaN. - * Note: this is not the same as the native isNaN function, - * which will also return true if the variable is undefined. - * @param object Check if this object is NaN. - * @return True if `object` is NaN, otherwise false. - **/ - export function isNaN(object: any): boolean; - /** * Returns true if the value of object is null. * @param object Check if this object is null.