Is there a javascript equivalent of Python\'s zip function? That is, given multiple arrays of equal lengths create an array of pairs.
For instance, if I have three
I modified flm's nifty answer to take an arbitrary number of arrays:
function* zip(arrays, i = 0) { while (arrays[0][i]) { yield arrays.map((arr, j) => arr[j < arrays.length - 1 ? i : i++]) } }