Skip to content

Day 1: Asynchronous JS & The Event Loop

Understand how JavaScript executes asynchronous code using the Call Stack, Web APIs, and the Event Loop.

JavaScript is single-threaded (one call stack). Long-running operations (network requests, timers) are delegated to the browser’s Web APIs. When complete, their callbacks join the Task Queue, which the Event Loop pushes to the call stack when empty.

  1. Predict the console order of console.log(1), setTimeout(..., 0), and console.log(2). Run it to verify!