Q11: What is the Node.js Event Loop and how does it work?
The Event Loop allows Node.js to perform non-blocking I/O operations despite JavaScript being single-threaded. It offloads tasks to the system kernel or Libuv thread pool. It cycles through phases: Timers, Pending Callbacks, Idle/Prepare, Poll, Check, and Close Callbacks.
Key Takeaways
- The Event Loop enables non-blocking I/O on a single thread.
- Libuv handles asynchronous underlying operations and thread pooling.
Knowledge Check
Which library manages the Event Loop in Node.js?