Concept
Node runs your JavaScript on one thread and hands slow work, such as network and disk I/O, to the system, picking up the results as callbacks. The event loop is the queue that decides what runs next.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show The event loop doing its job.
console.log("start");
setTimeout(() => console.log("timer"), 0);
Promise.resolve().then(() => console.log("microtask"));
process.nextTick(() => console.log("nextTick"));
console.log("end");
// start, end, nextTick, microtask, timerDoing CPU-heavy work, such as hashing or parsing a huge file, on the main thread. Every other request waits until it finishes. Move it to a worker thread or stream it.
Once a session shows you understand The event loop, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on The event loop.