@nevware21/ts-utils
    Preparing search index...

    Function arrZip

    • 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.

      Parameters

      • ...arrays: ArrayLike<any>[]

        Two or more arrays to zip together

      Returns any[][]

      A new array of arrays, grouped by index

      0.14.0

      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"]]