MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / reduceRight

Function reduceRight

MathBox/mathbox-bundle.js:38899–38908  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

forEachRightFunction · 0.85
callbackFunction · 0.70

Tested by

no test coverage detected