← All lessons
JavaScript
8 lessons you click through step by step
- How service workers workPut a worker between the page and the network, cache what matters, then keep working offline
- How hydration worksPaint server HTML, load the JavaScript, then attach handlers to a button that only looked ready
- How promises workFollow a promise from pending to settled, chain then and catch, and race several with all and any
- How closures workReturn a function that keeps its scope alive, then see why var in a loop prints the same number
- How garbage collection worksMark what the roots can reach, sweep the rest, and leak memory through a forgotten listener
- How debounce and throttle workHold back a burst of keystrokes and scroll events, then count the calls you save
- How Web Workers workMove heavy work off the main thread, pass messages, and keep the page smooth
- How the JavaScript event loop worksStep through the stack and queues to see what runs first