mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 04:17:49 +00:00
Issue #209, fix reduce without a memo for arrays that are sparse at the beginning.
This commit is contained in:
@@ -107,7 +107,7 @@
|
|||||||
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
|
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
|
||||||
}
|
}
|
||||||
each(obj, function(value, index, list) {
|
each(obj, function(value, index, list) {
|
||||||
if (!initial && index === 0) {
|
if (!initial) {
|
||||||
memo = value;
|
memo = value;
|
||||||
initial = true;
|
initial = true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user