• Gets the last item in an array.

    Type Parameters

    • T

      The generic type of the values in the array.

    Parameters

    • values: T[]

      The array of values.

    Returns T | undefined

    Undefined if the array is empty, otherwise the last value.