Returns an iterator over the items of all the input iterators, starting from
the zero index to the maximum index of the first argument. The
effective length of the iterator is the multiple of the length of thr smallest
iterator and the number of iterators (number of args).
Can be used to join arrays in a way no supported by concat, push, etc.
To pass an array as an iterator, call array.values().
Parameters
Rest...args: [Iterator<any, any, undefined>]
Returns Generator<any, void, unknown>
Example
for (letiofflat(range(10, range(15)))) { console.log(i); // 0, 0, 1, 1, 2, 2, .... till smallest iterable (10) is exhausted. }
Returns an iterator over the items of all the input iterators, starting from the zero index to the maximum index of the first argument. The effective length of the iterator is the multiple of the length of thr smallest iterator and the number of iterators (number of args).
Can be used to join arrays in a way no supported by
concat
,push
, etc. To pass an array as an iterator, call array.values().