firstIndexAsync() Function
Returns the first index in array
whose value satisfies the predicate
.
Signature
export declare function firstIndexAsync<T>(array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => PromiseLike<boolean>): Promise<number>;
Parameters
Parameter | Type | Description |
---|---|---|
array | readonly T[] | The array to search. |
predicate | (value: T, index: number, array: readonly T[]) => PromiseLike<boolean> | A predicate. There should exist some index |
(Returns) | Promise<number> | A promise that resolves to the first index in |