Complete the code to schedule a callback to run after the current operation using process.nextTick.
process.[1](() => { console.log('Runs before setImmediate'); });
process.nextTick schedules a callback to run immediately after the current operation, before any I/O events or timers.
Complete the code to schedule a callback that runs after I/O events using setImmediate.
set[1](() => { console.log('Runs after I/O events'); });
setImmediate schedules a callback to run after I/O events in the event loop.
Fix the error in the code to correctly schedule a callback with process.nextTick.
process.nextTick(() => {
console.log('First');
});
process.[1](() => {
console.log('Second');
});The method process.nextTick must be called exactly as is. 'tickNext' is invalid.
Fill both blanks to create a sequence where process.nextTick runs before setImmediate.
process.[1](() => { console.log('Runs first'); }); [2](() => { console.log('Runs second'); });
process.nextTick callbacks run before setImmediate callbacks in the event loop.
Fill all three blanks to create a code snippet that logs in this order: 'tick', 'timeout', 'immediate'.
process.[1](() => { console.log('tick'); }); set[2](() => { console.log('timeout'); }, 0); set[3](() => { console.log('immediate'); });
process.nextTick runs first, then setTimeout with 0 delay, then setImmediate.