Welcome to Timers, Callbacks and the Event Loop! So far, your programs have run from top to bottom. Real programs wait: for a timer, for a file, or for a server to reply. This course is about code that waits without freezing. It’s the first course in the Async JavaScript and Web APIs learning path, and you don’t need the other courses in the path to follow it.
The Laundry Room at 14 Ferris Road
Throughout the course, you’ll write a program for the laundry room of a shared house at 14 Ferris Road. Ines, Kofi, Wren, and Dev share its three machines: washer 1, washer 2, and the dryer. Here’s what the finished program prints when you run it:
$ node laundry_room.mjs
Laundry room alert for Kofi: washer 2's door is open
Ines, collect your laundry from washer 1
Ines, your laundry is still in washer 1 (nag 1)
Ines, your laundry is still in washer 1 (nag 2)
Ines emptied washer 1
Dev, collect your laundry from the dryer
Dev, your laundry is still in the dryer (nag 1)
Dev emptied the dryer
Your program tells each housemate when a door’s open or their load is done, and nags them until they collect it. Later in the course, sorting Dev’s lost socks makes every reminder late, and you’ll find out why.
What You’ll Learn
By the end of this course, you’ll know how to:
- Wait for slow work with timers, without freezing your program
- Predict when each callback runs, using the event loop
- Handle a result or an error with an error-first callback
- Notify several listeners with one event
- Run the laundry room at 14 Ferris Road
Before You Start
You need to know about passing functions around, closures and the call stack, modules, errors, and classes. If you’d like a refresher, then these RealJS courses cover them:
- Functions You Can Pass Around
- Scope, Closures and the Call Stack
- Modules and JSON: Programs Across Files
- When Things Go Wrong: Errors and Debugging
- Objects, this and Classes
For tools, you need a recent 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 ends with a coding exercise in your browser. A three-exercise project brings it together, then an AI mentor session, where you explain your laundry room’s code in your own words and make a change you haven’t seen, followed by a quiz and a summary. There’s a code download, and slides too.
It all starts with one question: How do you wait for the washer without standing over it? The next lesson, Wait Without Blocking, answers it.