• Returns a new array containing all but the last element of the given array. If the array is empty, raises an error.

    Parameters

    • anArray: any[]

      the array to consider

    Returns any[]

    a new array with all but the last element of anArray

    if the array is empty