Package: effect
Module: Array
Removes the last n elements, creating a new array.
When to use
Use to remove the last n elements from an iterable.
Details
n is clamped to [0, length].
Example (Dropping from the end)
import { Array } from "effect"
console.log(Array.dropRight([1, 2, 3, 4, 5], 2)) // [1, 2, 3]
See
drop — remove from the starttakeRight — keep from the endSignature
declare const dropRight: { (n: number): <A>(self: Iterable<A>) => Array<A>; <A>(self: Iterable<A>, n: number): Array<A>; }
Since v2.0.0