tail es-toolkit
Returns a new array consisting of all elements except the first.
Usage
tail(arr)
Use tail when you want to get all elements except the first from an array. If the array is empty or has only one element, it returns an empty array. It's useful when processing all elements except the first in a stack or queue.
It safely handles empty arrays and special cases.
Parameters
arrreadonly T[]required
The array from which to exclude the first element.
Returns
Returns a new array excluding the first element. If the input array is empty or has only one element, it returns an empty array.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.