Loading...
const all = [...defaults, ...userItems];
for (const item of all) render(item);const all = Iterator.concat(defaults, userItems);
for (const item of all) render(item);Iterator.concat() walks both sources in order without allocating a combined array.
Iterator.concat() is used instead of spreading into an array when the values are only iterated.next() to Iterator.concat()?No. Each argument must be an iterable with Symbol.iterator; wrap such an object with Iterator.from() first.
Iterator.concat()?No. Arguments must be objects, so a string throws a TypeError; pass Iterator.from(str) or [...str] instead.