If you call process.nextTick()multiple times, are callbacks done in order?
In other words, does the Node event loop give the same priority to all calls process.nextTickand execute them in FIFO order?
For instance:
process.nextTick(() => console.log('1'))
process.nextTick(() => console.log('2'))
process.nextTick(() =>
process.nextTick(() => console.log('3'))
)
process.nextTick(() =>
process.nextTick(() => console.log('4'))
)
Will this always print 1 2 3 4?
source
share