What is a Promise in JavaScript?

Ravi Ranjan Jaiswal
Ravi Ranjan Jaiswal

Posted On: Feb 22, 2018

 

An object that is able to produce a single value sometime in the future is known as Promise. The single value may either be a resolved value, or it can be a reason that it’s not resolved. There can be three states in which Promise can be:

  • Fulfilled
  • Reject
  • Pending

There can be callbacks that can be attached to handle the fulfilled value or the rejection’s reason, this can be done by the Promise users.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JavaScript Closure Interview Questions

    Enlist list advantages of closures in JavaScript?

    There are several advantages of using closures in JavaScript. Some of them are:Closure enables the use of nested functions that are used to get the values created in the execution context of that ...