🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Async JavaScript: all 10 questions

Quiz: Async JavaScript · Question 10 of 10

Why is JavaScript in the browser called single-threaded but non-blocking?

Why is JavaScript in the browser called single-threaded but non-blocking?

  1. A.It runs every task on a separate CPU core
  2. B.One thread runs your code, while timers and network requests wait in the background and their callbacks are queued
  3. C.It blocks until each network request finishes
  4. D.It cannot make network requests
Answer & explanation

Correct answer: One thread runs your code, while timers and network requests wait in the background and their callbacks are queued

The event loop runs queued callbacks when the call stack is empty.

Can you get the rest right without peeking?

Take the timed Quiz: Async JavaScript quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →