D
Deno

help

async map

Lleigh7/27/2023
Is there anyway using the stdlib to map from one array to another array, with the work being done concurrently with async?
Iiuioiua7/27/2023
Promise.all() - JavaScript | MDN
The Promise.all() static method takes an iterable of promises as input and returns a single Promise. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason.
Lleigh7/27/2023
Of course thanks. Is there any significance of Promise.all([...]) vs for await (const x of [...])?
Iiuioiua7/27/2023
Promise.all() is parallel. for await …) is sequential.

Looking for more? Join the community!