UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

27 lines 615 B
//#region src/compat/array/tail.d.ts /** * Gets all but the first element of array. * * @template T * @param array - The array to query. * @returns Returns the slice of array. * * @example * tail([1, 2, 3]); * // => [2, 3] */ declare function tail<T extends unknown[]>(array: readonly [unknown, ...T]): T; /** * Gets all but the first element of array. * * @template T * @param array - The array to query. * @returns Returns the slice of array. * * @example * tail([1, 2, 3]); * // => [2, 3] */ declare function tail<T>(array: ArrayLike<T> | null | undefined): T[]; //#endregion export { tail };