Games Node.js Loop Quest The express lane
Promise.all keeps order
Two timers wrapped in promises, the slow one first. What does Promise.all hand back?
const wait = (ms, v) => new Promise((r) => setTimeout(() => r(v), ms));Promise.all([wait(30, 'slow'), wait(10, 'fast')]) .then((vals) => console.log(vals.join(',')));console.log('waiting');1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…