Skip to content

lastIndicesWhereAsync

lastIndicesWhereAsync<T>(iterable, predicate, signal?): AsyncIterableIterator<number>

Defined in: packages/core/src/iterable/async/indices-where.ts:45

Yields the zero-based index of every element satisfying predicate, scanning from the end.

The async counterpart of lastIndicesWhere. An async source has no end to start from, so the whole of it is materialised first and held in memory.

Time complexity: O(n). Memory: O(n).

T

MaybeAsyncIterable<T>

The input iterable, sync or async.

MaybeAsyncPredicate<[T, number]>

Receives each element and its zero-based index.

AbortSignal

Aborts the materialisation.

AsyncIterableIterator<number>

An iterator over the matching indices, descending.