Options
All
  • Public
  • Public/Protected
  • All
Menu

Module zip

Index

References

Functions Array

References

Renames and re-exports zip

Array Functions

  • zip<T1, T2>(a1: T1[], a2: T2[]): [T1, T2][]
  • zip<T1, T2, T3>(a1: T1[], a2: T2[], a3: T3[]): [T1, T2, T3][]
  • zip<T1, T2, T3, T4>(a1: T1[], a2: T2[], a3: T3[], a4: T4[]): [T1, T2, T3, T4][]
  • Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.

    since

    5.3.0

    see

    unzip, unzipWith, zipObject, zipObjectDeep, zipWith

    example
    zip(['a', 'b'], [1, 2], [true, false])
    // => [['a', 1, true], ['b', 2, false]]

    Type Parameters

    • T1

    • T2

    Parameters

    • a1: T1[]
    • a2: T2[]

    Returns [T1, T2][]

    Returns the new array of grouped elements.

  • Type Parameters

    • T1

    • T2

    • T3

    Parameters

    • a1: T1[]
    • a2: T2[]
    • a3: T3[]

    Returns [T1, T2, T3][]

  • Type Parameters

    • T1

    • T2

    • T3

    • T4

    Parameters

    • a1: T1[]
    • a2: T2[]
    • a3: T3[]
    • a4: T4[]

    Returns [T1, T2, T3, T4][]