function drop
drop<T>(
list: T[],
n: number
): T[]

Returns a list with the first n elements removed. Does not mutate the input.

Examples

Example 1

drop([1, 2, 3, 4], 2); // [3, 4]
drop([1, 2], 5); // []

Type Parameters

Parameters

list: T[]
n: number

Return Type

T[]

Usage

import { drop } from ".";