* This method is like `_.reduce` except that it iterates over elements * of a `collection` from right to left. * * @static * @memberOf _ * @alias foldr * @category Collections * @param {Array|Object|string} collection The collection to iterate over. * @param {
(collection, callback, accumulator, thisArg)
| 38897 | * // => [4, 5, 2, 3, 0, 1] |
| 38898 | */ |
| 38899 | function reduceRight(collection, callback, accumulator, thisArg) { |
| 38900 | var noaccum = arguments.length < 3; |
| 38901 | callback = lodash.createCallback(callback, thisArg, 4); |
| 38902 | forEachRight(collection, function(value, index, collection) { |
| 38903 | accumulator = noaccum |
| 38904 | ? (noaccum = false, value) |
| 38905 | : callback(accumulator, value, index, collection); |
| 38906 | }); |
| 38907 | return accumulator; |
| 38908 | } |
| 38909 | |
| 38910 | /** |
| 38911 | * The opposite of `_.filter` this method returns the elements of a |
nothing calls this directly
no test coverage detected