Function maxWith

  • Finds the largest value using a comparator

    Type Parameters

    • T

    Parameters

    • values: T[]

      the list of values to compare

    • comparator: Comparator<T>

      compares the values

    Returns T

    the largest value

    thrown if values is empty