MCQ Practice Single Best Answer Topic: Javascript DOM & Event Handling MCQ

Q What will happen if setTimeout() is called with a timeout of 0 milliseconds?

Question ID
#5079
Subchapter
Javascript DOM & Event Handling MCQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A Placed in stack
  • B Placed in queue
  • C Will run continuously
  • D Will execute immediately
Correct Answer: B

Explanation

With a time of 0 ms, the function you select is not immediately called when you call setTimeout().
Instead, it is added to a queue and scheduled to be called "as soon as practicable" once any waiting event handlers are completed.

Share This Question

Share this MCQ with your friends or study group.