Package: effect
Module: Array
Drops elements from the start while the predicate holds, returning the rest.
When to use
Use to remove a leading prefix of elements that satisfy a predicate.
Details
The predicate receives (element, index).
Example (Dropping while condition holds)
import { Array } from "effect"
console.log(Array.dropWhile([1, 2, 3, 4, 5], (x) => x < 4)) // [4, 5]
See
takeWhile — keep the matching prefix insteaddrop — drop a fixed countSignature
declare const dropWhile: { <A>(predicate: (a: NoInfer<A>, i: number) => boolean): (self: Iterable<A>) => Array<A>; <A>(self: Iterable<A>, predicate: (a: A, i: number) => boolean): Array<A>; }
Since v2.0.0