Joint Iteration

This proposal is at Stage 2 of the TC39 process.

Open the console to try it out. Here are some examples:

Array.from(Iterator.zip([
  [0, 1, 2],
  [3, 4, 5],
]))
Array.from(Iterator.zipKeyed({
  a: [0, 1, 2],
  b: [3, 4, 5, 6],
  c: [7, 8, 9],
}))
Array.from(Iterator.zipKeyed({
  a: [0, 1, 2],
  b: [3, 4, 5, 6],
  c: [7, 8, 9],
}, {
  mode: 'longest',
  padding: { c: 10 },
}))
Fork me on GitHub