Skip to content

takeWhile

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

Defined in: Data/Arr.ts:761

Takes elements from the start while the predicate holds.

A

(a) => boolean

(data) => readonly A[]

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