Standard built-ins

Promise.all()

Try the free JavaScript compiler

Fulfills with all fulfillment values in iteration order or rejects when a constituent rejects. Does not cancel other operations.

Formal Syntax & Structure

javascript syntaxjavascript
Promise.all(iterable)

Parameters & Attributes

NameTypeDescription
iterableIterableValues or promises.

Return Value

Promise<Array>

Aggregate of all successful values.

Working Example

Example Snippetjavascript
let finish; const first = new Promise(r => { finish = r; });const second = Promise.resolve("B");Promise.all([first, second]).then(v => console.log(v.join(",")));finish("A");
JavaScript Reference