Permalink
Browse files

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 5edc3761c683e0f64688fa9f8dc3a156702b7241
Showing with 1 addition and 1 deletion.
  1. +1 −1 underscore.js
View
@@ -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 {

0 comments on commit 5edc376

Please sign in to comment.