- Mastering JavaScript Promises
- Muzzamil Hussain
- 153字
- 2021-07-16 13:46:49
Callback, revisited
In previous chapters, you learned how the JavaScript mechanism works. The single-threaded model of JavaScript has its limitation, which can be controlled through better use of callbacks. However, the scenarios such as callback hell really pushed engineers to find and implement a better way to control the callbacks and maximize the performance of the program, while staying inside a single thread. A callback is a function that can be passed as an argument to another function to be executed when it's called.
There is absolutely no harm in using callbacks, but there are also a number of other options available to handle asynchronous events. Promise is one such way to handle asynchronous events and has more efficiency than many of other asynchronous tools in its family.
To understand more clearly why we needed to implement Promises.js in asynchronous programming, we need to understand the concept behind the promise and deferred objects.
- DB2 V9權威指南
- Spring Cloud Alibaba微服務架構設計與開發實戰
- Python數據分析基礎
- Visual Basic編程:從基礎到實踐(第2版)
- 架構不再難(全5冊)
- Vue.js 2 and Bootstrap 4 Web Development
- C#程序設計(慕課版)
- Python Geospatial Development(Second Edition)
- 基于Swift語言的iOS App 商業實戰教程
- Orchestrating Docker
- Practical Predictive Analytics
- Learning Cocos2d-JS Game Development
- FusionCharts Beginner’s Guide:The Official Guide for FusionCharts Suite
- Flutter之旅
- C語言程序設計實驗指導與習題精解