FrontendInterviews.dev

675. Nested setTimeout Ordering

Easy•

Predict the output.

setTimeout(() => {
  console.log(1)
  setTimeout(() => console.log(2), 0)
}, 0)
setTimeout(() => console.log(3), 0)

What is printed in the console?

Select an option and submit your answer.
Next Problem