Skip to content

indicesWhereAsync

indicesWhereAsync<T>(iterable, predicate): AsyncIterableIterator<number>

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

Yields the zero-based index of every element satisfying predicate, rather than the elements themselves.

The async counterpart of indicesWhere.

Time complexity: O(1) per element.

T

MaybeAsyncIterable<T>

The input iterable, sync or async.

MaybeAsyncPredicate<[T, number]>

Receives each element and its zero-based index.

AsyncIterableIterator<number>

An iterator over the matching indices, ascending.