We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f8a8bb1 + de6f165 commit 0b16f58Copy full SHA for 0b16f58
test/objects.js
@@ -719,6 +719,7 @@
719
ok(!_.isNaN(void 0), 'undefined is not NaN');
720
ok(!_.isNaN(null), 'null is not NaN');
721
ok(!_.isNaN(0), '0 is not NaN');
722
+ ok(!_.isNaN(new Number(0)), 'wrapped 0 is not NaN');
723
ok(_.isNaN(NaN), 'but NaN is');
724
ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN');
725
});
underscore.js
@@ -1301,7 +1301,7 @@
1301
1302
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
1303
_.isNaN = function(obj) {
1304
- return _.isNumber(obj) && obj !== +obj;
+ return _.isNumber(obj) && isNaN(obj);
1305
};
1306
1307
// Is a given value a boolean?
0 commit comments