πŸ“Š JavaScript
Q. What will be the output of the following code snippet?
Code:
(function(){
 setTimeout(()=> console.log(1),2000);
 console.log(2);
 setTimeout(()=> console.log(3),0);
 console.log(4);
})();
  • (A) 1 2 3 4
  • (B) 2 3 4 1
  • (C) 2 4 3 1
  • (D) 4 3 2 1
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2 4 3 1

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
245
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
97%
Success Rate