Explain Promise in JavaScript?

devquora
devquora

Posted On: Feb 22, 2018

 

A promise is an object in JavaScript which is used to produce a value that may give results in the future. The value can be resolved value or it can be a reason which tells why the value is not resolved.

A promise can be of three states:

  • Fulfilled: The operation is completed and the promise has a specific value.
  • Rejected: The operation is failed and promise has a reason which shows why the operation failed.
  • Pending: Th operation is not fulfilled or rejected, which means it has not completed yet.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JavaScript Interview Questions

    Explain what is Javascript?

    Javascript Javascript is an object-oriented computer programming language commonly used to create interactive effects wi..