Type alias ArrayMin<Arr, M, Initial>

ArrayMin<Arr, M, Initial>: Arr["length"] extends 0
    ? Initial extends true
        ? never
        : M
    : Arr extends [infer A extends Numeric, ...(infer B extends Numeric[])]
        ? ArrayMin<B, _MinInTwoNums<A, M>, false>
        : M

Extracts the minimum numeric value in a given Array

Type Parameters

Example

Max<[-54,2,0,999,69,2]>; // Result: -54
Max<[-54,-2,-90,-72,-69,-202]>; // Result: -202