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

NameTypeDescription
iterableIterableValues 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]));
Node.js Reference