You're collecting async iterable results with a for-await loop. `Array.fromAsync` does it in one call.
dev.to·
Collecting items from an asynchronous source—such as a ReadableStream, database cursor, or paginated async generator—typically requires writing multi-line for-await-of loops. Standard array spreading fails on async sources because spread evaluation is synchronous. `Array.fromAsync` provides a built-in standard library utility that consumes, awaits, and aggregates async iterables into a plain array in a single call. It also accepts mapping functions, simplifying patterns that previously relied on combining `Promise.all` with `.map()`. Modern JavaScript developers can leverage `Array.fromAsync` to clean up async iteration ceremony, reduce boilerplate, and improve code readability across modern frontend and runtime environments.