Consume the iterator performing a side effect on each item in the sequence. Returns a promise that resolves when the iteration is finished.
import { pipe } from "yta";import { asAsync, range } from "yta/sync";import { forEach } from "yta/async";await pipe( range(5), asAsync(), forEach((n) => console.log(n)),);// => undefined// logs 0, 1, 2, 3, 4 Copy
import { pipe } from "yta";import { asAsync, range } from "yta/sync";import { forEach } from "yta/async";await pipe( range(5), asAsync(), forEach((n) => console.log(n)),);// => undefined// logs 0, 1, 2, 3, 4
See also:
The side effect function
Consume the iterator performing a side effect on each item in the sequence. Returns a promise that resolves when the iteration is finished.
See also: