Computer Science · JavaScript Programming
What will the following JavaScript code snippet output to the console? (function(){ setTimeout(()=> console.log(5), 2000); console.log(6); setTimeout(()=> console.log(7), 0); console.log(8); })();
- 15 6 7 8
- 26 7 8 5
- 36 8 7 5✓
- 48 7 6 5
Correct answer
6 8 7 5
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on JavaScript Programming?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · JavaScript Programming