0

console.log(10);
setTimeout(()=>{console.log(20),0});
console.log(30);

Why the callback timeout function still delays in output?

Jax-p
  • 5,223
  • 2
  • 20
  • 50

1 Answers1

0

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.