• Max gets the greatest value from a list

    Parameters

    • array: readonly [number, number]

    Returns number

    Example

    max([ 2, 3, 5]) == 5
    max([{ num: 1 }, { num: 2 }], x => x.num) == { num: 2 }
  • Parameters

    • array: readonly number[]

    Returns number | null

  • Type Parameters

    • T

    Parameters

    • array: readonly T[]
    • getter: ((item) => number)
        • (item): number
        • Parameters

          • item: T

          Returns number

    Returns T | null