Function zipIndex

  • Yields a tuple for each item in the iterable with the index of said item.

    Example

    zipIndex(["foo", "bar"]); // [[0, "foo"], [1, "bar"]]
    

    Yields

    Tuples with the index of each item.

    Type Parameters

    • SecondIterable extends AsynchronousIterable<unknown>

    Parameters

    • iterableSecond: SecondIterable

    Returns SecondIterable extends AsynchronousIterable<SecondItem> ? SecondIterable extends AsyncIterable<SecondItem> ? AsyncIterableIterator<readonly [number, SecondItem]> : IterableIterator<readonly [number, SecondItem]> : never