Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit dba1d76

Browse files
docs: Updated node-process-nexttick.en.md (#3266)
* Update node-process-nexttick.en.md setImmediate invocation should be before the setTimeout invocation to maintain the order of the logged numbers. Signed-off-by: Abhishek Guha <66299749+abhishekguha95@users.noreply.github.com> * Updated node-process-nexttick.en.md output sequence --------- Signed-off-by: Abhishek Guha <66299749+abhishekguha95@users.noreply.github.com>
1 parent 0fc3463 commit dba1d76

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

content/learn/asynchronous-work/node-process-nexttick.en.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ Use `nextTick()` when you want to make sure that in the next event loop iteratio
2828
```js
2929
console.log("Hello => number 1");
3030

31-
setTimeout(() => {
32-
console.log("The timeout running last => number 4");
33-
}, 0);
34-
3531
setImmediate(() => {
3632
console.log("Running before the timeout => number 3");
3733
});
3834

35+
setTimeout(() => {
36+
console.log("The timeout running last => number 4");
37+
}, 0);
38+
3939
process.nextTick(() => {
4040
console.log("Running at next tick => number 2");
4141
});
@@ -45,6 +45,6 @@ process.nextTick(() => {
4545
```bash
4646
Hello => number 1
4747
Running at next tick => number 2
48-
The timeout running last => number 4
4948
Running before the timeout => number 3
49+
The timeout running last => number 4
5050
```

0 commit comments

Comments
 (0)