What is a promise?
A promise is an object that may produce a single value some time in the future with a resolved value or an error reason (for example, a network error). There are 3 possible states: fulfilled, rejected, and pending.
Below is the syntax for creating a Promise:➡️ const promise = new Promise(function (resolve, reject) {
// promise description
});
No comments