effect-io-ai

Package: effect
Module: Array

Array.drop

Removes the first n elements, creating a new array.

When to use

Use to keep the suffix of an iterable after skipping a fixed number of leading elements.

Details

n is clamped to [0, length]. When n <= 0, this returns a copy of the full array.

Example (Dropping from the start)

import { Array } from "effect"

console.log(Array.drop([1, 2, 3, 4, 5], 2)) // [3, 4, 5]

See

Signature

declare const drop: { (n: number): <A>(self: Iterable<A>) => Array<A>; <A>(self: Iterable<A>, n: number): Array<A>; }

Source

Since v2.0.0