- Mastering JavaScript Promises
- Muzzamil Hussain
- 167字
- 2021-07-16 13:46:45
What is a promise?
When an eventual value is returned from the completion of a single operation, it represents a promise. If we analyze promise as a pact from human, it will help us understand the concept of promises in computer programming especially from the JavaScript perspective. Every promise is a pact among two or more parties to deliver some value to the other. The value can either be tangible or intangible, but a promise must deliver something in return. Until the promise is fulfilled, it remains in an unfulfilled state. However, when the said commitment has been made, the promise is said to be fulfilled. If the promise is not delivered as anticipated, the promise is said to fail.
So, what is a promise? According to the official definition:
Promise is an object or a function with a then method whose behavior confirms to this specification and represents the eventual result of an asynchronous operation.
The source of this definition is slide number 21 at http://www.slideshare.net/wookieb/callbacks-promises-generators-asynchronous-javascript.
- 精通Nginx(第2版)
- 數(shù)據(jù)庫原理及應(yīng)用(Access版)第3版
- 零基礎(chǔ)PHP學(xué)習(xí)筆記
- Apache Spark Graph Processing
- INSTANT MinGW Starter
- Python編程與幾何圖形
- INSTANT Sinatra Starter
- 小程序,巧應(yīng)用:微信小程序開發(fā)實戰(zhàn)(第2版)
- 平面設(shè)計經(jīng)典案例教程:CorelDRAW X6
- Mastering Android Studio 3
- Android 游戲開發(fā)大全(第二版)
- SFML Game Development
- Python數(shù)據(jù)科學(xué)實踐指南
- Getting Started with Windows Server Security
- JavaScript語法簡明手冊