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 19db749 + 7770a21 commit 9ac45c6Copy full SHA for 9ac45c6
test/collections.js
@@ -789,6 +789,7 @@
789
equal(_.size(new String('hello')), 5, 'can compute the size of string object');
790
791
equal(_.size(null), 0, 'handles nulls');
792
+ equal(_.size(0), 0, 'handles numbers');
793
});
794
795
test('partition', function() {
underscore.js
@@ -127,7 +127,7 @@
127
// Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
128
var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
129
var isArrayLike = function(collection) {
130
- var length = collection && collection.length;
+ var length = collection != null && collection.length;
131
return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
132
};
133
0 commit comments