Function initial

  • Gets all but the last element of array.

    Type Parameters

    • T = any

    Parameters

    • array: T[]

      The array to query.

    Returns T[]

    Returns the slice of array.

    Since

    5.18.0

    Example

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