1 | declare const _default: <T>(arr: T[], fn: string | ((v: T) => number)) => T;
|
2 | /**
|
3 | * @param {Array} arr The array to iterate over.
|
4 | * @param {Function} [fn] The iteratee invoked per element.
|
5 | * @return {*} Returns the maximum value.
|
6 | * @example
|
7 | *
|
8 | * var objects = [{ 'n': 1 }, { 'n': 2 }];
|
9 | *
|
10 | * maxBy(objects, function(o) { return o.n; });
|
11 | * // => { 'n': 2 }
|
12 | *
|
13 | * maxBy(objects, 'n');
|
14 | * // => { 'n': 2 }
|
15 | */
|
16 | export default _default;
|