From d2d3e27c039960844738fcf8f71f3a87ee6ea245 Mon Sep 17 00:00:00 2001 From: Aayush Raj Date: Fri, 26 Jun 2026 14:46:54 +0530 Subject: [PATCH] docs(asynchronous-work): clarify setImmediate() behavior Clarify that setImmediate() is not generally equivalent to setTimeout(() => {}, 0). Signed-off-by: Aayush Raj --- pages/asynchronous-work/discover-javascript-timers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/asynchronous-work/discover-javascript-timers.md b/pages/asynchronous-work/discover-javascript-timers.md index 908c816..962046c 100644 --- a/pages/asynchronous-work/discover-javascript-timers.md +++ b/pages/asynchronous-work/discover-javascript-timers.md @@ -179,4 +179,4 @@ to achieve this scenario: `setTimeout` and `setInterval` are available in Node.js, through the [Timers module](https://nodejs.org/api/timers.html). -Node.js also provides `setImmediate()`, which is equivalent to using `setTimeout(() => {}, 0)`, mostly used to work with the Node.js Event Loop. +Node.js also provides `setImmediate()`, which schedules a callback to execute during the check phase of the event loop. Unlike `setTimeout(() => {}, 0)`, it is not generally equivalent because their callbacks are executed in different phases of the event loop and their execution order depends on the execution context.