* The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Functi
(array, iteratee, comparator)
| 2902 | * @returns {*} Returns the extremum value. |
| 2903 | */ |
| 2904 | function baseExtremum(array, iteratee, comparator) { |
| 2905 | var index = -1, |
| 2906 | length = array.length; |
| 2907 | |
| 2908 | while (++index < length) { |
| 2909 | var value = array[index], |
| 2910 | current = iteratee(value); |
| 2911 | |
| 2912 | if (current != null && (computed === undefined |
| 2913 | ? (current === current && !isSymbol(current)) |
| 2914 | : comparator(current, computed) |
| 2915 | )) { |
| 2916 | var computed = current, |
| 2917 | result = value; |
| 2918 | } |
| 2919 | } |
| 2920 | return result; |
| 2921 | } |
| 2922 | |
| 2923 | /** |
| 2924 | * The base implementation of `_.fill` without an iteratee call guard. |