Skip to content

Commit

Permalink
Fixes _.isNaN for wrapped numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Damon Hunt authored and Damon Hunt committed Aug 3, 2015
1 parent f8a8bb1 commit 72caece
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@
ok(!_.isNaN(void 0), 'undefined is not NaN');
ok(!_.isNaN(null), 'null is not NaN');
ok(!_.isNaN(0), '0 is not NaN');
ok(!_.isNaN(new Number(0)), 'wrapped 0 is not NaN');
ok(_.isNaN(NaN), 'but NaN is');
ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN');
});
Expand Down
2 changes: 1 addition & 1 deletion underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@

// Is the given value `NaN`? (NaN is the only number which does not equal itself).
_.isNaN = function(obj) {
return _.isNumber(obj) && obj !== +obj;
return _.isNumber(obj) && obj != +obj;
};

// Is a given value a boolean?
Expand Down

0 comments on commit 72caece

Please sign in to comment.