ts-iterable-functions
    Preparing search index...

    Function zipConst

    • Combines two iterables by applying a selector to aligned pairs until either source is exhausted.

      Curried version of _zip.

      Type Parameters

      • T

        Element type produced by the first iterable.

      • TOther

        Element type produced by the second iterable.

      • TOut

        Element type yielded by the selector.

      Parameters

      • seq: Iterable<TOther>

        Secondary iterable providing the second element of each pair.

      • selector: (item1: T, item2: TOther) => TOut

        Function mapping a pair of elements to the emitted value.

      Returns (src: Iterable) => Iterable

      A deferred iterable yielding the selector results for each aligned pair.

      Error Rethrows any error thrown by selector.

      const result = _zip(
      [1, 2],
      ["a", "b"],
      (value, label) => `${value}${label}`
      );
      console.log([...result]); // ["1a", "2b"]

      or using the curried version:

      const result = [
      ...pipeInto(
      [1, 2],
      zip(
      ["a", "b"],
      (value, label) => `${value}${label}`
      )
      ),
      ];
      console.log(result); // ["1a", "2b"]