Games Node.js Loop Quest The express lane
Promises beat timers
A 0ms timer and a resolved promise. Which callback runs first?
setTimeout(() => console.log('timeout'), 0);Promise.resolve().then(() => console.log('promise'));console.log('sync');1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…
- 3…