UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

23 lines (22 loc) 692 B
/** * This method is like `max` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @since 5.8.0 * @category Math * @param array The array to iterate over. * @param iteratee The iteratee invoked per element. * @returns Returns the maximum value. * @example * * ```js * const objects = [{ 'n': 1 }, { 'n': 2 }] * * maxBy(objects, ({ n }) => n) * // => { 'n': 2 } * ``` */ export declare function maxBy<T>(array: ArrayLike<T>, iteratee?: any): T; export declare function maxBy(array: any, iteratee?: any): any; export default maxBy;