// Newer Iterator static method
Iterator.zipKeyed(iterables)
Iterator.zipKeyed(iterables, options)
// iterables : object of named iterables
// options : optional { mode, padding }
// returns : a new Iterator of objects
Parameters
Parameter
Description
iterables
Required. A plain object. Each property name becomes a key in the result objects. Each property value must be iterable (or an iterator). Strings need Iterator.from() when you want character streams.
options
Optional. An object with mode ("shortest", "longest", or "strict") and, for "longest", an optional padding object with the same keys.
Return Value
Return Value
Description
Iterator
A new iterator. Each value is an object with the same keys as iterables, filled with the next value from each input.
JavaScript Examples
Example 1 — Zip into Objects with Keys
Pair ids and names. Each step is an object you can read by key.
The Try It page first checks that Iterator.zipKeyed() exists, because Iterator helpers are still new. In an older browser it prints a short explanation and the output above. In a current browser it runs the code for real.
How It Works
Name the streams. Keys id and name label the two iterators.
Zip by key. Each step builds one object with those same keys.
Print rows.JSON.stringify shows {"id":1,"name":"Ann"} then the second person.
Example 2 — Stop When One Key Runs Out
Give one key more values than another. Default mode keeps only the matching prefix.
The Try It page first checks that Iterator.zipKeyed() exists, because Iterator helpers are still new. In an older browser it prints a short explanation and the output above. In a current browser it runs the code for real.
How It Works
Unequal inputs. Key a has three values; key b has two.
Shortest mode. Zipping stops when b ends, so only two objects are made.
Check the count.rows.length is 2, and the leftover 3 is not included.
Example 3 — Zip Streams from Iterator.from()
Build each named stream with Iterator.from(), then zip them into keyed rows.
The Try It page first checks that Iterator.zipKeyed() exists, because Iterator helpers are still new. In an older browser it prints a short explanation and the output above. In a current browser it runs the code for real.
How It Works
Wrap each list.Iterator.from() makes proper iterators for numbers and labels.
Zip by name. Each row has n and label filled from the same position.
Use the keys. Map over label for the text line, and sum n to get 30.
Compatibility
Browser & Runtime Support
Iterator.zipKeyed() is a newer Iterator static method for pairing values from several iterables. Support is still rolling out, so feature-detect first.
✓ Newer · Recent engines
Iterator.zipKeyed()
Supported in Chrome 146+, Edge 146+, Firefox 147+, Safari 26.4+, Opera 131+ and Node.js 24+. Internet Explorer never got it.
RecentStandard since
Google Chrome146+ · Desktop & Mobile
Full support
Microsoft Edge146+ · Chromium based
Full support
Mozilla Firefox147+ · Desktop & Mobile
Full support
Apple Safari26.4+ · macOS & iOS
Full support
Opera131+ · Chromium based
Full support
Samsung InternetRecent · Android
Supported
Android WebView146+ · Chromium based
Supported
Node.js24+ · Server runtime
Supported
DenoRecent versions · JavaScript runtime
Supported
BunRecent versions · JavaScript runtime
Supported
Internet ExplorerNo native support
Not supported
Iterator.zipKeyed()Recent engines
Bottom line: Feature-detect before use. A short manual loop that reads next() from each iterator can stand in on older engines.
Frequently Asked Questions
It walks several named iterables together. Each step yields one object whose keys match the names you passed, with the next value from each iterable.
zip() yields arrays like [1, "Ann"]. zipKeyed() yields objects like { id: 1, name: "Ann" }. Use zipKeyed() when named fields are clearer than positions.
Pass one object: Iterator.zipKeyed({ a: iterA, b: iterB }). Property names become result keys. Property values must be iterable or iterators.
By default, mode is "shortest", so zipping stops when any named input ends. Use mode "longest" with optional padding, or "strict" to throw when lengths differ.
Yes. The result is an Iterator, so you can map, filter, take, or call toArray() on it, just like other Iterator helper results.