Welcome to Promises and async/await! When each step of a program waits for the one before, callbacks nest, and nested callbacks get hard to follow. With promises and async functions, code that waits reads from top to bottom again. This course teaches you both.
A Day at the Museum
Throughout the course, you’ll build a planning script for the Adeyemi family’s day at the museum. Tolu, who is nine, Grandma Bisi, and their parents, Folake and Tunde, each pick artworks they want to see. The museum’s old kiosk is slow, and it answers through a callback. Your script looks up every pick and groups the titles by gallery. Tunde’s pick isn’t on view, so the plan says so instead of stopping. Here’s what the finished plan prints:
$ node plan_day.mjs
Couldn't plan 16568: Artwork 16568 isn't on view
{
'Gallery 241, second floor': [ 'The Bedroom' ],
'Gallery 262, second floor': [ 'Nighthawks' ],
'Gallery 240, second floor': [ 'A Sunday on La Grande Jatte — 1884' ]
}
Last, your script asks the real Art Institute of Chicago about one artwork and logs its title, artist, and date. This is the museum’s answer on 26 November 2026:
$ node show_artwork.mjs
A Sunday on La Grande Jatte — 1884
Georges Seurat
1884–86, border added 1888–89
What You’ll Learn
By the end of this course, you’ll know how to:
- Handle a value that arrives later with a promise
- Chain steps that depend on each other, and wrap a callback in a promise
- Write async functions that await each step and catch failures
- Predict the order of awaited code, promise callbacks and timers
- Plan the Adeyemi family’s day at the museum
Before You Start
This is the second course in the Async JavaScript and Web APIs learning path, and you can start here. You need to know how to write callbacks that run later, including Node’s error-first callbacks, and how the event loop decides when they run. You also need modules, JSON, and try and catch. If you’d like a refresher, then these RealJS courses cover them:
- Timers, Callbacks and the Event Loop, the first course in this path
- When Things Go Wrong: Errors and Debugging
- Modules and JSON: Programs Across Files
For tools, you need a current version of Node.js, a terminal, and any editor. The examples use Node.js 26:
$ node --version
v26.13.1
How the Course Works
The course mixes text lessons and videos, and you run their code in your terminal. Each of the first four sections has a coding exercise in your browser. After a three-exercise project brings it together, an AI mentor session asks you to explain your museum plan’s code in your own words and to make a change you haven’t seen. A quiz and a summary close the course. You also get slides and a code download, a ZIP file with the course’s code.
It all starts with the callbacks you already know. The next lesson, From Callbacks to Promises, starts with why nested callbacks get hard to follow.