A

Admin • 833K Points
Coach

Q. What does this code do?

Code:
setTimeout(() => console.log('Hello'), 0);
  • (A) Logs immediately
  • (B) Logs after 0 ms delay
  • (C) Never logs
  • (D) Throws error
  • Correct Answer - Option(B)
  • Views: 26
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

Even with 0 ms, the function is added to the event queue.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.