• Iterate several iterables in lockstep.

    Type Parameters

    • T

    Parameters

    • Rest ...objects: Iterable<T>[]

      The iterable objects of interest.

    Returns IterableIterator<T[]>

    An iterator which yields successive tuples of values where each value is taken in turn from the provided iterables. It will be as long as the shortest provided iterable.

    Example

    import { zip } from '@lumino/algorithm';

    let data1 = [1, 2, 3];
    let data2 = [4, 5, 6];

    let stream = zip(data1, data2);

    Array.from(stream); // [[1, 4], [2, 5], [3, 6]]