ts-iterable-functions
    Preparing search index...

    Function indexedConst

    • Pairs each element from the source iterable with its zero-based index.

      Curried version of _indexed.

      Type Parameters

      • T

        Element type produced by the source iterable.

      Returns (src: Iterable) => Iterable

      A deferred iterable yielding [item, index] tuples for every element.

      const pairs = [..._indexed(["a", "b", "c"])];
      console.log(pairs); // [["a", 0], ["b", 1], ["c", 2]]

      or using the curried version:

      const pairs = [
      ...pipeInto(
      ["a", "b", "c"],
      indexed()
      ),
      ];
      console.log(pairs); // [["a", 0], ["b", 1], ["c", 2]]