Package: effect
Module: Array
Returns the index of the last element matching the predicate, wrapped in an
Option.
When to use
Use to find the index of the last matching element from the end of an array.
Example (Finding the last matching index)
import { Array } from "effect"
console.log(Array.findLastIndex([1, 3, 8, 9], (x) => x < 5)) // Option.some(1)
See
findFirstIndex — search from the startfindLast — get the element itselfSignature
declare const findLastIndex: { <A>(predicate: (a: NoInfer<A>, i: number) => boolean): (self: Iterable<A>) => Option.Option<number>; <A>(self: Iterable<A>, predicate: (a: A, i: number) => boolean): Option.Option<number>; }
Since v2.0.0