• Get the last element from an array similair to pop but without removing the element.

    Type Parameters

    • T

    Parameters

    • array: readonly T[]

      Atray to get the last element from. Array is not altered.

    Returns T | undefined