mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Merging in Issue #54
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user