Function max

  • Finds the largest value.

    Accepts either a single argument with a list of values or multiple arguments as values.

    Values are compared using naturalOrder.

    Type Parameters

    • T

    Parameters

    • values: T[]

      values to compare

    Returns T

    the largest value

    thrown if values is empty

  • Finds the largest value.

    Accepts either a single argument with a list of values or multiple arguments as values.

    Values are compared using naturalOrder.

    Type Parameters

    • T

    Parameters

    • first: T

      the first value to compare

    • second: T

      the first value to compare

    • Rest...rest: T[]

      any other values to compare

    Returns T

    the largest value