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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Logs after 0 ms delay
Explanation: Even with 0 ms, the function is added to the event queue.
Explanation by: Chandani
Even with 0 ms, the function is added to the event queue.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
82
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
80%
Success Rate