Skip to content

minBy

minBy<T>(iterable, valueOf): T | null

Defined in: select/min-by.ts:15

Returns the item with the smallest valueOf(item), or null if the iterable is empty. Ties resolve to the first item seen.

Time complexity: O(n), with one valueOf call per item.

T

Iterable<T>

The input iterable.

Callable<[T], number>

Numeric key extractor.

T | null

The minimum item, or null for an empty iterable.