1 var arrayReduceRight = require('../internal/arrayReduceRight'),
2 baseEachRight = require('../internal/baseEachRight'),
3 createReduce = require('../internal/createReduce');
6 * This method is like `_.reduce` except that it iterates over elements of
7 * `collection` from right to left.
12 * @category Collection
13 * @param {Array|Object|string} collection The collection to iterate over.
14 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
15 * @param {*} [accumulator] The initial value.
16 * @param {*} [thisArg] The `this` binding of `iteratee`.
17 * @returns {*} Returns the accumulated value.
20 * var array = [[0, 1], [2, 3], [4, 5]];
22 * _.reduceRight(array, function(flattened, other) {
23 * return flattened.concat(other);
25 * // => [4, 5, 2, 3, 0, 1]
27 var reduceRight = createReduce(arrayReduceRight, baseEachRight);
29 module.exports = reduceRight;