console.log(10);
setTimeout(()=>{console.log(20),0});
console.log(30);
Why the callback timeout function still delays in output?
console.log(10);
setTimeout(()=>{console.log(20),0});
console.log(30);
Why the callback timeout function still delays in output?
setTimeout() is asynchronous and that means that even if you set timer to zero, it will still be done after all of your code. Search asynchronous function to learn more.