An object to keep track of an item considered to be a minimum, based on the given getValue selector.
getValue
Items with a non-finite numeric value (e.g. NEGATIVE_INFINITY,POSITIVE_INFINITY, NaN, null, undefined) are ignored.
NEGATIVE_INFINITY
POSITIVE_INFINITY
NaN
null
undefined
export function minBy<T>( iterable: Iterable<T>, selector: (item: T) => number): [item: T, value: number] | [] { const min = new MinimumTracker<T>(selector); for (const item of iterable) { min.consider(item); } return min.result;}
Protected
Optional
Readonly
Generated using TypeDoc
An object to keep track of an item considered to be a minimum, based on the given
getValue
selector.Items with a non-finite numeric value (e.g.
NEGATIVE_INFINITY
,POSITIVE_INFINITY
,NaN
,null
,undefined
) are ignored.See
Example