mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Fixing _.any returning an incorrect result when Array.prototype.some is
missing but Array.prototype.forEach exists.
This commit is contained in:
@@ -186,7 +186,10 @@
|
||||
if (obj == null) return result;
|
||||
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
|
||||
each(obj, function(value, index, list) {
|
||||
if (result = iterator.call(context, value, index, list)) return breaker;
|
||||
if (iterator.call(context, value, index, list)) {
|
||||
result = true;
|
||||
return breaker;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user