Two or more arrays to zip together
A new array of arrays, grouped by index
arrZip([1, 2, 3], ["a", "b", "c"]); // [[1, "a"], [2, "b"], [3, "c"]]
arrZip([1, 2], ["a", "b", "c"]); // [[1, "a"], [2, "b"]]
arrZip([1, 2, 3], ["a", "b"], [true, false]); // [[1, "a", true], [2, "b", false]]
arrZip([1], []); // []
// Array-like objects
arrZip({ length: 2, 0: 1, 1: 2 }, ["x", "y"]); // [[1, "x"], [2, "y"]]
The arrZip() method creates a new array of grouped elements, where the first array contains the first elements of each input array, the second array contains the second elements, and so on. The length of the result is determined by the shortest input array.