Function last

  • Gets the last element of array.

    Type Parameters

    • T

    Parameters

    • array: ArrayLike<T>

      The array to query.

    Returns T

    Returns the last element of array.

    Since

    5.6.0

    Example

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