Notes video
Example: video note
This is a starter video note. Copy it, or delete it once you add your own.
Use note_type = "video" and put the YouTube URL in source so the video embeds at the top. Headings like 12:40 make timestamped notes easy to scan.
Takeaways
- The browser event loop is a queue: JavaScript runs one thing at a time, then picks the next callback.
- Rendering and I/O are not the same queue as your JS callbacks.
setTimeout(fn, 0)does not run immediately; it waits until the current stack is clear.
Notes
01:15 — Call stack
JS is single-threaded. Each function call is pushed onto the stack and popped when it returns.
08:40 — Task queue
Callbacks from setTimeout, DOM events, and XHR land on the queue. The event loop moves one callback onto the stack only when the stack is empty.
14:20 — Rendering
The browser wants to render around 60 times per second. Long-running JS blocks that work, which is why the page feels frozen.