Function zipArrays

  • Zip a collection of arrays to create an array of tuples from matching indices.

    Returns

    the zipped array

    Note

    the zipped array has the length of the shortest input array

    Example

    zipArrays([1, 2, 3], ['a', 'b', 'c']) === [[1, 'a'], [2, 'b'], [3, 'c']]
    

    Example

    zipArrays([1], ['a', 'b', 'c']) === [[1, 'a']]
    

    Type Parameters

    • TArrs extends unknown[][]

    Parameters

    • Rest ...arrays: TArrs

    Returns Zipped<TArrs>

Generated using TypeDoc