Async JavaScript explained: promises, fetch and async await

A free, focused course on the event loop, promises, async functions, fetch, cancellation and error handling, with runnable examples

8 ratings 4,462 students Sample

Created by Tomas Lindqvist

  • Updated September 2026
  • English
  • Intermediate

What you will learn

  • Explain the event loop and predict the order in which async code runs
  • Create, chain and combine promises correctly
  • Write async functions with proper error handling and parallelism
  • Use fetch with status checks, timeouts and AbortController
  • Prevent race conditions when responses arrive out of order
  • Limit concurrency and retry failed requests with backoff

Course content

5 sections, 24 lessons, 4h 6m total

How async JavaScript works 5 lessons · 51 min
  • Video: Why JavaScript needs async code Preview 8 min
  • Article: The event loop in plain words Preview 13 min
  • Article: Promises from the inside 13 min
  • Article: async and await 12 min
  • Quiz: Check your understanding 5 min
Working with fetch 5 lessons · 53 min
  • Video: fetch responses and status codes 11 min
  • Video: Sending data with POST and headers 10 min
  • Video: Timeouts and AbortController 12 min
  • Article: Caching responses in memory 9 min
  • Video: Retries with exponential backoff 11 min
Async problems in user interfaces 4 lessons · 41 min
  • Video: Race conditions in search boxes 12 min
  • Video: Debouncing and throttling 10 min
  • Article: Loading, error and empty states 9 min
  • Video: Optimistic updates and rollback 10 min
Combining and controlling promises 4 lessons · 42 min
  • Video: Promise.all, allSettled, race and any 13 min
  • Video: Limiting concurrency 11 min
  • Article: Converting callback APIs 8 min
  • Video: Unhandled rejections and debugging 10 min
Beyond single values 6 lessons · 59 min
  • Video: Async iterators and for await 11 min
  • Video: Streams with fetch 12 min
  • Video: Web Workers for heavy work 10 min
  • Video: Testing async code 11 min
  • Video: Async patterns in Node.js 10 min
  • Quiz: Final check 5 min

Requirements

  • JavaScript basics: functions, objects, arrays and arrow functions
  • A browser, and optionally Node.js 20 or newer

Description

Asynchronous code is where many JavaScript developers lose confidence. Callbacks that run in an unexpected order, promises that never resolve, errors that vanish without a trace, and race conditions when users click faster than the network responds. These problems are not mysterious once you understand a few core ideas.

This free course explains asynchronous JavaScript from the ground up. We start with the event loop in plain words, then build up to promises, async functions, fetch, cancellation, retries and running tasks with limited concurrency.

What you will learn

  • How the event loop, task queue and microtask queue decide what runs when
  • Creating and consuming promises, and chaining them correctly
  • async and await, including error handling and parallel work
  • Using fetch properly: status codes, JSON, timeouts and cancellation
  • Handling race conditions in user interfaces
  • Combinators: Promise.all, allSettled, race and any
  • Async iteration and streams at an introductory level

How it works

Each lesson has small examples you can run in the browser console or with Node.js. Several lessons show the same task written three ways, with callbacks, promise chains and async await, so you can read older code as well as write modern code.

You should already know JavaScript basics: functions, arrays, objects and arrow functions.

Who this course is for

  • Developers who use async await but feel unsure about what happens underneath
  • Front end developers dealing with loading states and race conditions
  • Back end JavaScript developers working with many I/O calls

Instructor

Tomas Lindqvist

JavaScript and TypeScript teacher focused on fundamentals that last longer than frameworks

  • 4.5 instructor rating
  • 22 reviews
  • 10,782 students
  • 3 courses
  • Sample

I have written JavaScript for browsers and servers for a long time, and I still think the language itself is the best investment a web developer can make. Frameworks change every few years. Closures, the event loop and a good type system do not.

I teach in small steps with lots of short exercises. Every lesson ends with something you can run in the browser console or in Node, so you never have to take my word for it.

When I am not recording, I maintain internal tooling and libraries written in TypeScript, and I spend more time than I should reading the ECMAScript proposals list.

View profile

Student reviews

4.5 8 ratings
5 star 63%
4 star 25%
3 star 13%
2 star 0%
1 star 0%
Mohammed R. Oct 3, 2026
Sample

forEach with async was my bug

One sentence about forEach not waiting fixed a bug I had been chasing for a day.

Patrick D. Sep 22, 2026
Sample

The event loop finally makes sense

Predicting the order of logs before running them was a brilliant exercise. I use the mental model every day now.

Svetlana I. Aug 27, 2026
Sample

Fixed a race condition at work

The search box lesson described a bug we had in production for months. Aborting stale requests fixed it.

Tunde O. Jul 23, 2026
Sample

Excellent and free

Very clear explanations. The streams lesson was a bit quick but still useful.

Laura B. Jun 15, 2026
Sample

Promise.all versus allSettled explained

I always confused the combinators. The realistic examples made each one stick.

Kim N. Apr 22, 2026
Sample

Great retry and backoff section

The retry helper is now in our codebase. I would like more on Node.js specifically.

Arnav G. Feb 27, 2026
Sample

Some overlap with basics

The first lessons repeat things I knew, but the later sections were worth the time.

Elena C. Jan 13, 2026
Sample

Should be required for front end devs

So many loading state bugs come down to the ideas in this course. Clear and practical.

Free Enroll now
SampleSample catalog: the instructors, courses, reviews and stats on this site are demo content.