Skip to content

takeWhile

takeWhile<A>(predicate): (data) => readonly A[]

Defined in: Core/Arr.ts:503

Takes elements from the start while the predicate holds.

A

(a) => boolean

(data): readonly A[]

readonly A[]

readonly A[]

pipe([1, 2, 3, 1], Arr.takeWhile(n => n < 3)); // [1, 2]