ixfx
    Preparing search index...

    Function pairwise

    • Combines values in pairwise fashion. Throws an error if there are less than two entries.

      pairwise([1, 2, 3, 4, 5]);
      Yields:
      [[1,2],[2,3],[3,4],[4,5] ]

      pairwise([ 1, 2, 3, 4 ]);
      Yields:
      [1,2],[2,3],[3,4]

      Type Parameters

      • T

      Parameters

      • values: T[]

      Returns Generator<T[], void, unknown>