JavaScript · Async JavaScript

Promise

Represents a future value. Resolve with a value or reject with an Error.

Syntax
new Promise((resolve, reject) => { … })

Example

Try it

More in this group

AbortController async / await clearTimeout() Event loop order fetch() Promise.all() Promise.allSettled() Promise.any()

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course