Node.js - Timers and Scheduling
Consider this Node.js code snippet:
Which issue causes unexpected order of output, and how to fix it?
setTimeout(() => console.log('timeout'));
setImmediate(() => console.log('immediate'));
process.nextTick(() => console.log('nextTick'));
process.nextTick(() => console.log('another nextTick'));Which issue causes unexpected order of output, and how to fix it?
