Games Node.js Loop Quest Round the loop
Inside I/O, immediate wins
The same two calls, but this time inside a file-read callback.
const fs = require('node:fs');fs.readFile(__filename, () => { setTimeout(() => console.log('timeout'), 0); setImmediate(() => console.log('immediate'));});1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…