The answer
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.
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.
Browse all our FAQs or reach out to our support team
Your learning library
Find your next course. Build something great.
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success
Success