Function eachPair

  • Iterator for key value pair of an array or object.

    Example

    for (const [i, v] of eachPair(['a', 'b']) {
    console.log(i, v); //0 a, 1 b
    }

    for (const [i, v] of eachPair({'foo': 'bar}) {
    console.log(i, v); //foo bar
    }

    Type Parameters

    • T

    Parameters

    • object: ArrayLike<T>

    Returns IterableIterator<[number, T]>

  • Type Parameters

    • T

    Parameters

    • object: {
          [s: string]: T;
      }
      • [s: string]: T

    Returns IterableIterator<[string, T]>

Generated using TypeDoc