zipArrays the art of merging two or more arrays of identical length pair wise.
const zip = (arr, ...arrs) =>
arr.map((val, i) =>
arrs.reduce((a, arr) => [...a, arr[i]], [val]));
examples:
const a = [1, 2, 3];
const b = [4, 5, 6];
const c = [7, 8, 9];
zip(a, b); // [[1, 4], [2, 5], [3, 6]]
zip(a, b, c); // [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
zip.apply(null, zip(a, b)); // [[1, 2, 3], [4, 5, 6]]