ts-iterable-functions
    Preparing search index...

    Function mapConst

    • Projects each element of the source iterable into a new form.

      Curried version of _map.

      Type Parameters

      • T

        Element type produced by the source iterable.

      • TOut

        Element type produced by the selector.

      Parameters

      • selector: IndexedSelector<T, TOut>

        Selector receiving each element and its index, producing the projected value.

      Returns (src: Iterable) => Iterable

      A deferred iterable yielding the selector results for each source element.

      Error Rethrows any error thrown by selector.

      const squares = [..._map([1, 2, 3], (value) => value * value)];
      console.log(squares); // [1, 4, 9]

      or using the curried version:

      const squares = [
      ...pipeInto(
      [1, 2, 3],
      map((value) => value * value)
      ),
      ];
      console.log(squares); // [1, 4, 9]