Skip to content

includesAsync

includesAsync<T>(iterable, item, comparator?, signal?): Promise<boolean>

Defined in: packages/core/src/iterable/async/includes.ts:18

Checks whether item occurs in iterable.

The async counterpart of includes.

Time complexity: O(n), short-circuiting on the first match.

T

MaybeAsyncIterable<T>

The iterable to search, sync or async.

T

The item to search for.

EqualityComparator<T, T> = ...

The equality comparison function to use (default is isEqual with “sameValueZero” strategy).

AbortSignal

Aborts the search.

Promise<boolean>

true if a matching item was found, false otherwise.