From 5edc3761c683e0f64688fa9f8dc3a156702b7241 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 13 Jul 2011 12:27:11 -0400 Subject: [PATCH] Issue #209, fix reduce without a memo for arrays that are sparse at the beginning. --- underscore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore.js b/underscore.js index bf004d3ca..8a2a65622 100644 --- a/underscore.js +++ b/underscore.js @@ -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 {