- Mastering JavaScript Promises
- Muzzamil Hussain
- 123字
- 2021-07-16 13:46:46
States of a promise
Promise is based on three states. Each state has a significance and can be used to drive a certain level of result as per the need. This can help a programmer choose as per his/her need. The three states of a promise are as follows:
- Pending: This is the initial state of a promise
- Fulfilled: This is the state of a promise representing a successful operation
- Rejected: This is the state of a promise representing a failed operation
Once a promise is fulfilled or rejected, it is immutable (that is, it can never change again).
With reference to the concepts discussed earlier, it's now clear what a promise is and how you can use it with all its potential.
推薦閱讀
- Web程序設計及應用
- 微服務設計原理與架構
- 零基礎學MQL:基于EA的自動化交易編程
- The DevOps 2.4 Toolkit
- Linux Device Drivers Development
- Visual C#.NET程序設計
- The Complete Coding Interview Guide in Java
- PLC應用技術(三菱FX2N系列)
- Hands-On Nuxt.js Web Development
- 貫通Tomcat開發
- PhoneGap 4 Mobile Application Development Cookbook
- 微前端設計與實現
- Enterprise Application Architecture with .NET Core
- MATLAB從入門到精通
- C#.NET程序設計