Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Issue #209, fix reduce without a memo for arrays that are sparse at t…
…he beginning.
  • Loading branch information
jashkenas committed Jul 13, 2011
1 parent 174c897 commit 5edc376
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion underscore.js
Expand Up @@ -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 {
Expand Down

0 comments on commit 5edc376

Please sign in to comment.