2 * A specialized version of `baseAggregator` for arrays.
5 * @param {Array} array The array to iterate over.
6 * @param {Function} setter The function to set `accumulator` values.
7 * @param {Function} iteratee The iteratee to transform keys.
8 * @param {Object} accumulator The initial aggregated object.
9 * @returns {Function} Returns `accumulator`.
11 function arrayAggregator(array, setter, iteratee, accumulator) {
13 length = array.length;
15 while (++index < length) {
16 var value = array[index];
17 setter(accumulator, value, iteratee(value), array);
22 module.exports = arrayAggregator;