effect-io-ai

Package: effect
Module: Chunk

Chunk.dropRight

Drops the last n elements.

Example (Dropping elements from the end)

import { Chunk } from "effect"

const chunk = Chunk.make(1, 2, 3, 4, 5)
const result = Chunk.dropRight(chunk, 2)
console.log(Chunk.toArray(result)) // [1, 2, 3]

Signature

declare const dropRight: { (n: number): <A>(self: Chunk<A>) => Chunk<A>; <A>(self: Chunk<A>, n: number): Chunk<A>; }

Source

Since v2.0.0