Asynchronous JavaScript
Blocking vs non-blocking code, timers, the event loop, callbacks, promises, combinators and async/await, with exact output you can predict.
JavaScript in a page runs on one thread: one list of instructions, done one at a time. Yet a page waits for servers, timers and clicks without freezing. This phase explains how: the browser does the waiting, and JavaScript is told when each result is ready.
You'll start with what blocking means and why it hurts, then learn timers, and then the most important picture in the language: the event loop, with its call stack, task queue and microtask queue. Once you can predict the order of any output, callbacks, promises and async/await stop being magic. They are just different ways of saying "run this later".
Every example is live and prints exact output, so you can predict first and then check. You'll need functions and closures from Phase 3 and events from Phase 9. Phase 11 builds directly on this one: fetch returns a promise.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.