Function minByFn

  • It will iterate through each of the provided values array, by the provided iteratee function and add the resulting numbers returned by the said iteratee function to produce the minimum,

    Type Parameters

    • Value

    Parameters

    • values: Value[]

      The array to iterate over.

    • iteratee: ((value) => number)

      The iteratee invoked per element.

        • (value): number
        • Parameters

          Returns number

    Returns number

    The minimum value.

    Since

    1.0.0

    Example

    minByFn([1, 2, 3], number => number); // => 1
    

    Example

    minByFn([{ a: 1 }, { a: 2 }, { a: 3 }], ({ a }) => a); // => 1