1.

What is a promise? Where and how would you use promise?

Answer»

A promise means to the object which is responsible for producing a single value as the result in the upcoming future WHETHER it is resolved or not.

Promises are used to manage asynchronous operations.

How to use the promise:

LET promise = new Promise(function(resolve, reject) {
// asynchronous call
});
Promise uses a callback function as the argument and that callback function takes 2 arguments: the FIRST ONE is the resolve function or the other one is the reject function.



Discussion

No Comment Found