What is a Promise?

Node.js modules, files and async · Freshers

Model answer

A Promise represents a value that will be available later. It is pending, then fulfilled with a value or rejected with an error. You use .then() and .catch(), or await inside an async function. Promise.all runs several promises in parallel and waits for all.

Learn this topic

Async JavaScript in Node: Promises, async/await and the Event Loop in the course Node.js and Express: Build a Back End API from Scratch.

Sign in to add your own answer.

More questions