@newdash/newdash
Version:
javascript/typescript utility library
22 lines (21 loc) • 628 B
TypeScript
/**
* This method is like `min` 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 minimum value.
* @example
*
* ```js
* const objects = [{ 'n': 1 }, { 'n': 2 }]
*
* minBy(objects, ({ n }) => n)
* // => { 'n': 1 }
* ```
*/
export declare function minBy<T>(array: ArrayLike<T>, iteratee?: any): T;
export default minBy;