Ensure _.every returns false as soon as the callback result is falsey.

Former-commit-id: d5488688c4a30376999b04ba80f1551af403b516
This commit is contained in:
John-David Dalton
2012-10-28 00:28:40 -07:00
parent 4eff301db3
commit 2ad6faae3a
4 changed files with 25 additions and 4 deletions

View File

@@ -1883,9 +1883,9 @@
var result = true;
callback = createCallback(callback, thisArg);
forEach(collection, function(value, index, collection) {
return (result = callback(value, index, collection));
return (result = !!callback(value, index, collection));
});
return !!result;
return result;
}
/**