Function last

  • Gets the last element of array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to query.

    Returns T | undefined

    Returns the last element of array.

    0.1.0

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