SyntaxStudy
Sign Up
Home JavaScript Exercises Promises and Async/Await

Promises and Async/Await

Intermediate

Fill in the promise and async/await syntax.

To create a promise: new ((resolve, reject) => { ... })

To handle a resolved promise: promise.(result => ...)

To handle a rejection: promise.(err => ...)

To pause execution and wait for a promise inside an async function: fetchData()

A function that returns a promise is declared with the keyword.