Skip to main content

max

Callable

  • max<T>(xs: T): T extends Traversable<infer I> ? T extends readonly [unknown, ...unknown[]] ? T[number] : Maybe<I> : T

  • Calculate the maximum value of the given items.

    Example

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

    Alternatives


    Type parameters

    Parameters

    • xs: T

      The values to check.

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

    The maximum value of the traversable.