Function zip

  • Returns a generator that aggregates elements from the iterables producing tuples with the next element from each one.

    Returns

    Tuples with elements from each iterator

    Example

    for item of zip([1, 2, 3], ['sugar', 'spice', 'nice'])
    console.log(item)
    // [1, 'sugar']
    // [2, 'spice']
    // [3, 'nice']

    Parameters

    • Rest ...args: Iterable<any>[]

      The iterables to zip

    Returns Generator<any[], void, unknown>

Generated using TypeDoc