Frontend Engineer
The timer says zero. It still runs last.
- 1Your approach
- 2The follow-up
- 3Reflect & learn
THE INTERVIEWER ASKS
The scenario
Predict the log order: console.log("A"); setTimeout(() => console.log("B"), 0); Promise.resolve().then(() => console.log("C")); console.log("D"). Explain why.
How would you approach it?
Explain your assumptions, your approach, and why you chose it.