Skip to content

Commit

Permalink
Merging in Issue jashkenas#54
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Nov 1, 2010
1 parent a08c3db commit da3eddd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@
_.reduceRight = _.foldr = function(obj, iterator, memo, context) {
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
if (context) iterator = _.bind(iterator, context);
var args = [iterator];
if (memo !== undefined) args.push(memo);
return obj.reduceRight.apply(obj, args);
return memo !== void 0 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
}
var reversed = (_.isArray(obj) ? obj.slice() : _.toArray(obj)).reverse();
return _.reduce(reversed, iterator, memo, context);
Expand Down

0 comments on commit da3eddd

Please sign in to comment.