Promises

A promise (Promise) represents the future result of an asynchronous operation: pending, fulfilled, or rejected. You consume it with .then() and .catch() or with async / await. Promise.all waits for several promises in parallel and fails as soon as one is rejected; errors are handled with try / catch.

Example

const [a, b] = await Promise.all([lireA(), lireB()]);

Related concepts

The whole glossary