Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/asynchronous-work/understanding-processnexttick.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The event loop is busy processing the current function code. When this operation

It's the way we can tell the JS engine to process a function asynchronously (after the current function), but as soon as possible, not queue it.

Calling `setTimeout(() => {}, 0)` will execute the function at the end of next tick, much later than when using `nextTick()` which prioritizes the call and executes it just before the beginning of the next tick.
Calling `setTimeout(() => {}, 0)` schedules the callback for a future event loop iteration, much later than when using `process.nextTick()`, which executes before the event loop continues.

Use `nextTick()` when you want to make sure that in the next event loop iteration that code is already executed.

Expand Down