mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
dont try to look at the keys of zero-length arrays or arguments objects when calling each()
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
try {
|
||||
if (obj.forEach) {
|
||||
obj.forEach(iterator, context);
|
||||
} else if (obj.length) {
|
||||
} else if (obj.length || obj.length === 0) {
|
||||
for (var i=0, l=obj.length; i<l; i++) iterator.call(context, obj[i], i, obj);
|
||||
} else {
|
||||
var keys = _.keys(obj), l = keys.length;
|
||||
|
||||
Reference in New Issue
Block a user