Javascript: Understanding Promise

Promise is a proxy value for an asynchronous action leading upto success or a failure. Using Promise is necessary to avoid the callback hell A pending promise can either be fulfilled with a value, or rejected with a reason (error). When either of these options happens, the associated handlers queued up by a promise’s then…