What is Event Loop in JavaScript?

Description:

The event loop handles JavaScript's asynchronous execution, allowing non-blocking operations.

Explanation:

JavaScript uses a single-threaded event loop to manage asynchronous operations via the call stack, callback queue, and microtask queue.

Example:

console.log("Start");

setTimeout(() => console.log("Timeout"), 0);

console.log("End");

// Output: 
// Start
// End
// Timeout

Even though the timeout is 0ms, JavaScript processes synchronous code first before handling asynchronous operations.