_.toArray is just _.values for objects

This commit is contained in:
Jeremy Ashkenas
2010-01-03 22:05:10 -05:00
parent 6427ac5813
commit abb0f7f194

View File

@@ -226,7 +226,7 @@
if (iterable.toArray) return iterable.toArray();
if (_.isArray(iterable)) return iterable;
if (_.isArguments(iterable)) return slice.call(iterable);
return _.map(iterable, function(val){ return val; });
return _.values(iterable);
};
// Return the number of elements in an object.