yta
    Preparing search index...

    Function forEach

    • Consume the iterator performing a side effect on each item in the sequence.

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

      pipe(
      range(5),
      forEach((n) => console.log(n)),
      );
      // logs 0, 1, 2, 3, 4

      See also:

      Type Parameters

      • A

      Parameters

      • fn: (item: A) => void

        The side effect function

      Returns (items: Iterable<A>) => void