Function pop

Removes the last element from an array and returns it.

  • Type Parameters

    • T

    Parameters

    • array: T[]

      The array to remove the last element from.

    Returns undefined | T

    • The last element of the array, or undefined if the array is empty.