mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Ensure _.reduce doesn't assign accumulator a collection value if its length is 0.
This commit is contained in:
2
dist/lodash.compat.js
vendored
2
dist/lodash.compat.js
vendored
@@ -4109,7 +4109,7 @@
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
|
||||
if (noaccum) {
|
||||
if (noaccum && length) {
|
||||
accumulator = collection[++index];
|
||||
}
|
||||
while (++index < length) {
|
||||
|
||||
Reference in New Issue
Block a user