UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

26 lines (24 loc) 652 B
import { ArrayPredicate } from "./internals/types.js"; //#region src/array/findLastIndex.d.ts /** * `findLastIndex(array, predicate)` * * Returns the index of the last element in `array` that satisfies the provided `predicate` function, or -1 if no element is found. * * ```ts * findLastIndex([1, 2, 3, 4], (x) => x > 2); // 3 * ``` * * ```ts * pipe( * [1, 2, 3, 4], * findLastIndex((x) => x > 2), * ); // 3 * ``` */ declare const findLastIndex: { <T>(predicate: ArrayPredicate<T>): (target: readonly T[]) => number; <T>(target: readonly T[], predicate: ArrayPredicate<T>): number; }; //#endregion export { findLastIndex };