You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
449 B
16 lines
449 B
/**
|
|
* @param {Array} arr The array to iterate over.
|
|
* @param {Function} [fn] The iteratee invoked per element.
|
|
* @return {*} Returns the maximum value.
|
|
* @example
|
|
*
|
|
* var objects = [{ 'n': 1 }, { 'n': 2 }];
|
|
*
|
|
* maxBy(objects, function(o) { return o.n; });
|
|
* // => { 'n': 2 }
|
|
*
|
|
* maxBy(objects, 'n');
|
|
* // => { 'n': 2 }
|
|
*/
|
|
declare const _default: <T>(arr: T[], fn: ((v: T) => number) | string) => T | undefined;
|
|
export default _default;
|
|
|