Sha256: a5d6e9016e7943a839973e149325cda1a0b38ede0eb7174ac32d98bc8f59ed17
Contents?: true
Size: 786 Bytes
Versions: 153
Compression:
Stored size: 786 Bytes
Contents
/** * A specialized version of `_.reduceRight` for arrays without support for * callback shorthands and `this` binding. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initFromArray] Specify using the last element of `array` * as the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initFromArray) { var length = array.length; if (initFromArray && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } module.exports = arrayReduceRight;
Version data entries
153 entries across 80 versions & 8 rubygems