- 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.
- Spring 5.0 By Example
- OpenCV實例精解
- SQL學習指南(第3版)
- 數據庫系統原理及MySQL應用教程
- INSTANT MinGW Starter
- Amazon S3 Cookbook
- Full-Stack React Projects
- Learning OpenStack Networking(Neutron)(Second Edition)
- Windows Embedded CE 6.0程序設計實戰
- Quantum Computing and Blockchain in Business
- JavaScript程序設計(第2版)
- 硬件產品設計與開發:從原型到交付
- Vue.js光速入門及企業項目開發實戰
- UML軟件建模
- Mudbox 2013 Cookbook