Skip to content

drop

drop<T>(iterable, count): IterableIterator<T>

Defined in: packages/core/src/iterable/drop.ts:15

Yields everything after the first count elements.

What Array.prototype.slice(count) does for an array, without materialising. An input shorter than count yields nothing.

Time complexity: O(n) — the skipped elements are still pulled from the source, because an iterable offers no way to seek past them.

T

Iterable<T>

The input iterable.

number

How many elements to skip. Must be a non-negative integer.

IterableIterator<T>

An iterator over the remaining elements.

If count is not a non-negative integer.