2 * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
3 * with one argument: (value).
6 * @param {Array} array The array to iterate over.
7 * @param {Function} iteratee The function invoked per iteration.
8 * @param {Function} comparator The function used to compare values.
9 * @param {*} exValue The initial extremum value.
10 * @returns {*} Returns the extremum value.
12 function arrayExtremum(array, iteratee, comparator, exValue) {
14 length = array.length,
18 while (++index < length) {
19 var value = array[index],
20 current = +iteratee(value);
22 if (comparator(current, computed)) {
30 module.exports = arrayExtremum;