79595741

Date: 2025-04-28 03:15:35
Score: 1.5
Natty:
Report link

Most of these answers still work but I wanted to bring up a much newer option: Array.fromAsync(). It's avaliable on all major browsers and Node.js 22.

From MDN, here's probably the part of most interest:

The Array.fromAsync() static method creates a new, shallow-copied Array instance from an async iterable, iterable, or array-like object...

Array.fromAsync() awaits each value yielded from the object sequentially. Promise.all() awaits all values concurrently.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Jeremy Nguyen