Collect the iterator into a promise of an array.
import { pipe } from "yta";import { asAsync, range } from "yta/sync";import { toArray } from "yta/async";await pipe(range(5), asAsync(), toArray());// => [0, 1, 2, 3, 4] Copy
import { pipe } from "yta";import { asAsync, range } from "yta/sync";import { toArray } from "yta/async";await pipe(range(5), asAsync(), toArray());// => [0, 1, 2, 3, 4]
Collect the iterator into a promise of an array.