minBy (Functional Programming) es-toolkit
Creates a function that returns the value with the smallest computed score. Use it with pipe.
Info
Usage
minBy calls getValue for each value in the piped array and returns the value with the smallest result. If the array is empty, it returns undefined.
Parameters
getValue(item: T) => numberrequired
The function that returns the value used for comparison.
Returns
A function that maps a readonly T[] to the minimum item, or undefined.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.