Stage 1 · Lesson 10 of 10
Promises and async/await, a first look
JavaScript runs your code on one thread, one step at a time. It does not wait for slow work such as a timer, a network request or reading a file with node:fs/promises. Instead it hands back a , a value that will be ready later, and carries on.
async and await let you write this as if it ran in order, such as const text = await readFile("data.json", "utf8") inside an async . is the part of JavaScript that runs your code again when the slow work finishes.
That is why console.log output can appear in a surprising order. readFileSync is enough for this stage, but you will need this the moment you call an .
Common trapforgetting await and holding a Promise instead of the data.
A question to check yourself, an AI practice session and 2 cheat sheet entries come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking JavaScript Fundamentals
Design Gurus · Beginner · $50
The language itself, closures and async included, with runnable exercises per lesson
- GuideFreeJavaScript.info
Ilya Kantor
Free: Part 1 is the most complete modern JavaScript tutorial, with tasks per chapter