JavaScript promises

JavaScript promises, async/await, and asynchronous flow

Learn JavaScript promises, async/await, asynchronous JavaScript, callbacks, promise chaining, error handling, Promise API methods, microtasks, generators, async iteration, the event loop, and Fetch API flow.

Promise and async/await lessons

  1. Callbacks before promises

    Start with callback-based asynchronous flow so promise syntax solves a concrete problem.

    Outcome: Understand why deeply nested callback code becomes hard to compose and debug.

    • JavaScript callbacks
    • asynchronous JavaScript
    • callback function
    Study Introduction: callbacks
  2. Promise basics

    Learn promise states, fulfillment, rejection, executors, then handlers, and how promises represent future results.

    Outcome: Model asynchronous work as a value that can settle later.

    • JavaScript promises
    • promise basics
    • fulfilled rejected
    Study Promise
  3. Promise chaining

    Pass values through then chains and compose asynchronous steps without deeply nested callbacks.

    Outcome: Build sequential async logic that remains readable as it grows.

    • promise chaining
    • then chain
    • asynchronous flow
    Study Promises chaining
  4. Promise error handling

    Handle rejected promises, propagation, recovery values, and catch placement deliberately.

    Outcome: Design promise flows with clear success and failure paths.

    • promise error handling
    • catch promise
    • rejected promise
    Study Error handling with promises
  5. Promise API

    Use Promise.all, Promise.allSettled, Promise.race, Promise.any, and related helpers for combined async work.

    Outcome: Choose the right Promise API method for parallel work, racing, and partial failures.

    • Promise.all
    • Promise.race
    • Promise.allSettled
    Study Promise API
  6. Microtasks

    Understand how promise callbacks run in the microtask queue and how that affects execution order.

    Outcome: Predict ordering between synchronous code, promises, timers, and rendering.

    • microtasks
    • microtask queue
    • promise jobs
    Study Microtasks
  7. Async/await

    Write promise-based code with async functions, await, try/catch, and sequential-looking control flow.

    Outcome: Refactor promise chains into readable async functions without changing the underlying model.

    • async await
    • JavaScript async
    • await promise
    Study Async/await
  8. Generators

    Learn paused function execution with generators and connect generator thinking to asynchronous iteration.

    Outcome: Understand controllable iteration before studying async generators.

    • JavaScript generators
    • yield
    • generator function
    Study Generators
  9. Async iterators and generators

    Process asynchronous streams of values with async iteration and async generator syntax.

    Outcome: Handle async data sources one value at a time with clear iteration flow.

    • async iterators
    • async generators
    • for await
    Study Async iteration and generators
  10. Event loop

    Study tasks, microtasks, macrotasks, rendering, and the browser event loop behind asynchronous JavaScript.

    Outcome: Explain why async callbacks run when they do and avoid ordering surprises.

    • JavaScript event loop
    • macrotasks
    • microtasks
    Study Event loop: microtasks and macrotasks
  11. Fetch and promises

    Use promise-based network requests, response parsing, aborting, progress, and HTTP error handling.

    Outcome: Connect promise and async/await knowledge to real browser data loading.

    • Fetch API
    • JavaScript fetch
    • async requests
    Study Fetch
  12. Fetch API details

    Go deeper into request and response objects, headers, methods, and browser fetch behavior.

    Outcome: Build more deliberate client-side API calls after learning async control flow.

    • Fetch API JavaScript
    • Request Response
    • HTTP fetch
    Study Fetch API