Open keturn opened 1 week ago
I believe this may be implemented as
function chain(...iterators) {
return iterators.flatMap(identity);
}
which is succinct, but a bit quirky maybe.
Alternatively,
function* chain(...iterators) {
for (const iterator of iterators) {
yield* iterator;
}
}
Python calls it
itertools.chain
:Like
Array.concat
, but lazy, and doesn't need its iterables to be marked withSymbol.isConcatSpreadable
.(does the toolkit not have an Iterator Utilities section yet?)