Understanding JavaScript Promises
286
READERS
90
PAGES
16,589
WORDS
60 DAYS
GUARANTEE
ENGLISH
EPUB
WEB
Book Description
Learn all about JavaScript promises from veteran JavaScript author Nicholas C. Zakas.
Since promises were added to JavaScript in 2015, they have become an integral part of the language. A good understanding of how promises work is more important than ever in becoming a proficient JavaScript developer. This book is written to introduce the promises and their intricacies in a straightforward, easy to read format. Each chapter is filled with practical, real-world examples using the techniques discussed, and all examples are available for download with your purchase.
What you’ll learn:
Which parts of promises are synchronous and which are asynchronous
How to effectively use promise chains to simplify your code
The best way to catch errors in promises
How to create your own promises
Ways to work with multiple promises at once
How async functions and await expression hide promise complexities
What happens to rejected promises without rejection handlers
Table of Contents
Introduction
About This Book
Acknowledgments
About the Author
Disclaimer
1. Promise Basics
The Promise Lifecycle
Creating New (Unsettled) Promises
Creating Settled Promises
Summary
2. Chaining Promises
Catching Errors
Using finally() in Promise Chains
Returning Values in Promise Chains
Returning Promises in Promise Chains
Summary
3. Working with Multiple Promises
The Promise.all() Method
The Promise.allSettled() Method
The Promise.any() Method
The Promise.race() Method
Summary
4. Async Functions and Await Expressions
Defining Async Functions
What Makes Async Functions Different
Summary
5. Unhandled Rejection Tracking
Detecting Unhandled Rejections
Web Browser Unhandled Rejection Tracking
Node.js Unhandled Rejection Tracking
Summary
Final Thoughts
Download the Extras
Support the Author
Help and Support
Follow the Author
Notes