Function max

  • Computes the maximum value of array. If array is empty or falsey, undefined is returned.

    Type Parameters

    • T

    Parameters

    • array: ArrayLike<T>

      The array to iterate over.

    Returns T

    Returns the maximum value.

    Since

    5.6.0

    Example

    _.max([4, 2, 8, 6]);
    // => 8

    _.max([]);
    // => undefined