UNPKG

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