Skip to content

min

min<T>(xs): T extends Iterable<infer I> ? T extends readonly [unknown, ...unknown[]] ? T[number] : Maybe<I> : T

Calculate the minimum value of the given items.

Example

min([1, 2, 3])
// => 1

Alternatives

Type Parameters

T extends Iterable<string | number | bigint>

The element type.

Parameters

xs

T

The values to check.

Returns

T extends Iterable<infer I> ? T extends readonly [unknown, ...unknown[]] ? T[number] : Maybe<I> : T

The minimum value of the Iterable.