Skip to content

Commit e5a3b87

Browse files
committed
fix: improve 'Understanding process.nextTick()' page example code.
1 parent 0b24039 commit e5a3b87

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/site/pages/en/learn/asynchronous-work/understanding-processnexttick.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ Use `nextTick()` when you want to make sure that in the next event loop iteratio
3131
console.log('Hello => number 1');
3232

3333
setImmediate(() => {
34-
console.log('Running before the timeout => number 3');
34+
console.log('Running at order 3 or 4, setImmediate');
3535
});
3636

3737
setTimeout(() => {
38-
console.log('The timeout running last => number 4');
38+
console.log('Running at order 3 or 4, setTimeout');
3939
}, 0);
4040

4141
process.nextTick(() => {
4242
console.log('Running at next tick => number 2');
4343
});
4444
```
4545

46-
#### Example output:
46+
#### Example output(possible):
4747

4848
```bash
4949
Hello => number 1
5050
Running at next tick => number 2
51-
Running before the timeout => number 3
52-
The timeout running last => number 4
51+
Running at order 3 or 4, setImmediate
52+
Running at order 3 or 4, setTimeout
5353
```
5454

55-
The exact output may differ from run to run.
55+
The exact output may differ from run to run. [setImmediate vs setTimeout](https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick#setimmediate-vs-settimeout) explain the reason.

0 commit comments

Comments
 (0)