Why must the call stack be empty for setTimeout callbacks to run?
Because the event loop only moves callbacks from the queue onto the stack when the stack is empty. If a synchronous function is still running, queued callbacks wait.
Explore This Question
Search for additional explanations using these tools:
More FAQs in What Is the Call Stack in JavaScript?
Still have questions?
Browse all our FAQs or reach out to our support team
