yta
    Preparing search index...

    Function map

    • Map each item in the iterator.

      import { pipe } from "yta";
      import { map, range, toArray } from "yta/sync";

      pipe(
      range(3),
      map((x) => x * 2),
      );
      // => [0, 2, 4]

      See also:

      Type Parameters

      • A

        The input type

      • B

        The output type

      Parameters

      • fn: (item: A) => B

        The mapping function

      Returns (items: Iterable<A>) => Generator<B, void>