You’ll learn how JavaScript schedules code, how to stop it, and when to use workers. Your project is a weather-station dashboard, ported from Python. Each weather station, such as Ridge, sends samples to a panel, and an operator refreshes the panels.
Here’s a first taste. The dashboard asks a timer to update the Ridge panel with a delay of 0, then sums
Ridge’s samples:
setTimeout(() => console.log("Ridge panel updated"), 0);
const samples = [8, 12, 10];
const total = samples.reduce((sum, value) => sum + value, 0);
console.log("Ridge summary:", total);
The sum prints first anyway, and the panel waits:
Ridge summary: 30
Ridge panel updated
Would a longer sum keep the panel frozen? The next lesson finds out.
The operator presses refresh twice. Here, sleep() stands in for the station’s radio link: the first
reply, 8, takes 300 milliseconds, and the newer one, 12, takes 50:
import { setTimeout as sleep } from "node:timers/promises";
const dashboard = { ridge: "no reading yet" };
async function refreshRidge(delay, value) {
const reading = await sleep(delay, value);
dashboard.ridge = reading;
console.log("Ridge panel:", dashboard.ridge);
}
await Promise.all([refreshRidge(300, 8), refreshRidge(50, 12)]);
The panel shows 12, then 8:
Ridge panel: 12
Ridge panel: 8
The older reading wins, with no error.
The real dashboard polls stations and stops polls when a shift ends. In the project, it sums samples in workers and prints both stations in order, with a total of 40:
{ id: 'Ridge', total: 30, count: 3 }
{ id: 'Harbor', total: 10, count: 2 }
total 40
By the end of this course, you’ll be able to:
- See why a timer waits for running code, and in what order promise jobs,
queueMicrotask()callbacks and timers run - Stop a poll with
AbortController, and combine a deadline with an operator stop usingAbortSignal.timeout()andAbortSignal.any() - Keep old readings out of the dashboard with a generation counter, and reserve a slot before you
await - Move CPU work to a worker, and share a counter deliberately with
SharedArrayBufferandAtomics - Build the station summary dashboard, with one worker per station and every worker’s exit awaited
In Python, you only need to know asyncio’s event loop, tasks and cancellation, and threads and processes. In JavaScript, you
only need to know promises, async functions with await, Promise.all(), timers, and modules.
You’ll need Node 26 or later installed, and no packages. The examples use Node 26 and Python 3.15.
The course mixes short videos with text lessons and exercises. Every video has a summary below it. A project video builds the dashboard, and a quiz and a summary close the course.
Next up: Why a Timer Waits for Your Code, where you see why a due timer can’t break into running code.