Promises
Promise.all()
Fulfills with results in input order when all fulfill, or rejects if an input rejects. Does not limit concurrency or cancel other tasks.
Formal Syntax & Structure
nodejs syntaxnodejs
Promise.all(iterable)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| iterable | Iterable | Values or promises to aggregate. |
Return Value
Promise
Array of fulfillment values or rejection.
Working Example
Example Snippetnodejs
console.log(await Promise.all([Promise.resolve(2), 3]));