Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / internal / arrayReduceRight.js
1 /**
2  * A specialized version of `_.reduceRight` for arrays without support for
3  * iteratee shorthands.
4  *
5  * @private
6  * @param {Array} array The array to iterate over.
7  * @param {Function} iteratee The function invoked per iteration.
8  * @param {*} [accumulator] The initial value.
9  * @param {boolean} [initAccum] Specify using the last element of `array` as the initial value.
10  * @returns {*} Returns the accumulated value.
11  */
12 function arrayReduceRight(array, iteratee, accumulator, initAccum) {
13   var length = array.length;
14   if (initAccum && length) {
15     accumulator = array[--length];
16   }
17   while (length--) {
18     accumulator = iteratee(accumulator, array[length], length, array);
19   }
20   return accumulator;
21 }
22
23 module.exports = arrayReduceRight;