mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +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 (obj == null) return result;
|
||||||
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
|
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
|
||||||
each(obj, function(value, index, list) {
|
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;
|
return result;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user