Issue #209, fix reduce without a memo for arrays that are sparse at the beginning.

This commit is contained in:
Jeremy Ashkenas
2011-07-13 12:27:11 -04:00
parent 174c897fce
commit 5edc3761c6

View File

@@ -107,7 +107,7 @@
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
}
each(obj, function(value, index, list) {
if (!initial && index === 0) {
if (!initial) {
memo = value;
initial = true;
} else {