Skip to content

findIndex

findIndex<A>(predicate): (data) => Option<number>

Defined in: Core/Arr.ts:111

Returns the index of the first element matching the predicate, or None.

A

(a) => boolean

(data): Option<number>

readonly A[]

Option<number>

pipe([1, 2, 3, 4], Arr.findIndex(n => n > 2)); // Some(2)