![]() Settled - This state represents that the promise has been either rejected or fulfilled.Ī promise is created using the Promise constructor which takes in a callback function with two parameters, resolve and reject respectively.Rejected - This state represents that the promise has been rejected for some reason, meaning the async operation has failed.Fulfilled - This state represents that the promise has been fulfilled, meaning the async operation is completed.This state represents that the promise has neither been fulfilled nor been rejected, it is in the pending state. But due to limited functionality of callback, using multiple callbacks to handle asynchronous code can lead to unmanageable code. Promises are used to handle asynchronous operations in javascript.īefore promises, callbacks were used to handle asynchronous operations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |