zipLongest
zipLongest<
T,F>(iterables,fill):IterableIterator<ZippedLongest<T,F>>
Defined in: packages/core/src/iterable/zip-longest.ts:28
Yields tuples pairing the first element of every iterable, then the second,
and so on, continuing until the longest one runs out and substituting
fill for every iterable that has already ended.
The counterpart of zip, which stops at the shortest instead.
Every source iterator is closed when iteration ends, whether it ended by exhaustion or because the consumer stopped pulling.
Time complexity: O(1) per tuple, allocating one tuple per yield.
Type Parameters
Section titled “Type Parameters”T extends readonly Iterable<unknown, any, any>[]
F
Parameters
Section titled “Parameters”iterables
Section titled “iterables”T
The iterables to advance in lockstep.
F
The value standing in for an iterable that has already ended.
Returns
Section titled “Returns”IterableIterator<ZippedLongest<T, F>>
An iterator over the tuples. Empty when no iterables were given.