mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Bump to v4.14.0.
This commit is contained in:
5
maxBy.js
5
maxBy.js
@@ -12,8 +12,7 @@ var baseExtremum = require('./_baseExtremum'),
|
||||
* @since 4.0.0
|
||||
* @category Math
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Array|Function|Object|string} [iteratee=_.identity]
|
||||
* The iteratee invoked per element.
|
||||
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
|
||||
* @returns {*} Returns the maximum value.
|
||||
* @example
|
||||
*
|
||||
@@ -28,7 +27,7 @@ var baseExtremum = require('./_baseExtremum'),
|
||||
*/
|
||||
function maxBy(array, iteratee) {
|
||||
return (array && array.length)
|
||||
? baseExtremum(array, baseIteratee(iteratee), baseGt)
|
||||
? baseExtremum(array, baseIteratee(iteratee, 2), baseGt)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user