Skip to content

min() function

Returns the smallest of the given iterable/AsyncIterable

Signature:

typescript
declare function min<A extends Iterable<number> | AsyncIterable<number>>(iterable: A): ReturnValueType<A, number>;

Example

ts
min([1, 3, 5]); // 1;
min([1, NaN, 2]); // NaN;
min([1, Infinity, 3]); // 1;
min([1, -Infinity, 3]); // -Infinity;
min([]); // Infinity

Open Source Code

Released under the Apache-2.0 License.