ts-iterable-functions
    Preparing search index...

    Function _map

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

      Type Parameters

      • T

        Element type produced by the source iterable.

      • TOut

        Element type produced by the selector.

      Parameters

      • src: Iterable<T>

        Source iterable to transform.

      • selector: IndexedSelector<T, TOut>

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

      Returns Iterable<TOut>

      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]