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);
})();
β
Correct Answer: (C)
2 4 3 1