Promises

suggest change

Syntax

Remarks

Promises have been standard since ECMAScript 2015 and are available in modern browsers and JavaScript runtimes. An async function always returns a promise, and await provides clearer syntax for many sequential workflows.

Promise reaction callbacks run asynchronously as microtasks, even when the promise is already settled. A promise represents one eventual outcome and does not itself cancel the underlying operation; APIs that support cancellation commonly accept an AbortSignal.

Choose the concurrency combinator that matches the required behavior:

Introduction

Promise chaining

Waiting for multiple concurrent promises

Reduce an array to chained promises

Waiting for the first of multiple concurrent promises

Promisifying functions with callbacks

Error Handling

Reconciling synchronous and asynchronous operations

Delay function call

Promisifying values

Using ES2017 async / await

forEach() with promises

Performing cleanup with finally

Asynchronous API request

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents