JavaScript Async Programming and Promises
8 steps · about 3 h 15 min · Intermediate
- Introducing asynchronous JavaScript and the single-threaded event loop (guide, MDN Web Docs, 25 min)
Understand blocking execution, asynchronous callbacks, and call stack mechanics.
- How to use Promises in JavaScript (tutorial, MDN Web Docs, 30 min)
Work with pending, fulfilled, and rejected Promise states and chaining then() handlers.
- Creating and resolving custom Promises (guide, MDN Web Docs, 25 min)
Wrap asynchronous callbacks and timers inside new Promise instances.
- Pausing and resolving promises with the await operator (reference, MDN Web Docs, 25 min)
Unwrap fulfilled promise values cleanly and pause async execution without callbacks.
- Error handling in asynchronous code with try, catch, and finally (guide, MDN Web Docs, 20 min)
Catch rejected promises and network errors reliably inside async function bodies.
- Concurrent execution with Promise.all and Promise.allSettled (guide, MDN Web Docs, 25 min)
Fetch multiple independent resources simultaneously and handle fail-fast vs all-settled scenarios.
- Timeouts and racing promises with Promise.race and Promise.any (guide, MDN Web Docs, 20 min)
Implement request timeout wrappers and fastest-response fallbacks.
- Cancelling pending asynchronous operations with AbortController (guide, MDN Web Docs, 25 min)
Cancel obsolete fetch requests and event listeners when components unmount or queries change.