JavaScript Async Programming and Promises

8 steps · about 3 h 15 min · Intermediate

  1. Introducing asynchronous JavaScript and the single-threaded event loop (guide, MDN Web Docs, 25 min)

    Understand blocking execution, asynchronous callbacks, and call stack mechanics.

  2. How to use Promises in JavaScript (tutorial, MDN Web Docs, 30 min)

    Work with pending, fulfilled, and rejected Promise states and chaining then() handlers.

  3. Creating and resolving custom Promises (guide, MDN Web Docs, 25 min)

    Wrap asynchronous callbacks and timers inside new Promise instances.

  4. 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.

  5. 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.

  6. 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.

  7. Timeouts and racing promises with Promise.race and Promise.any (guide, MDN Web Docs, 20 min)

    Implement request timeout wrappers and fastest-response fallbacks.

  8. 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.