Is JavaScript multi-threaded because of the event loop?
No. The JS engine has one call stack (one thread). Web APIs may run on separate browser threads, but only one JS statement runs at a time. The event loop moves callbacks to the single stack.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Common Event Loop Misconceptions in JavaScript
No. The callback goes to the macrotask queue. The event loop runs it only after the call stack is empty and all microtasks are done. It runs after all synchronous code, not immediately.
No. Promise callbacks are microtasks; setTimeout callbacks are macrotasks. Microtasks always run before macrotasks, regardless of when they were scheduled. This is why a promise runs before a timer with 0 delay.
No. await pauses the async function and returns control to the caller. The engine continues running other code. The rest of the function runs as a microtask when the promise settles and the stack is empty.
Still have questions?
Browse all our FAQs or reach out to our support team
