* A specialized version of `_.max` for arrays without support for iteratees. * * @private * @param {Array} array The array to iterate over. * @returns {*} Returns the maximum value.
(array)
| 2951 | * @returns {*} Returns the maximum value. |
| 2952 | */ |
| 2953 | function arrayMax(array) { |
| 2954 | var index = -1, |
| 2955 | length = array.length, |
| 2956 | result = NEGATIVE_INFINITY; |
| 2957 | |
| 2958 | while (++index < length) { |
| 2959 | var value = array[index]; |
| 2960 | if (value > result) { |
| 2961 | result = value; |
| 2962 | } |
| 2963 | } |
| 2964 | return result; |
| 2965 | } |
| 2966 | |
| 2967 | /** |
| 2968 | * A specialized version of `_.min` for arrays without support for iteratees. |