Skip to content

Commit e343fdb

Browse files
Wee Jian Hui KevinWee Jian Hui Kevin
authored andcommitted
Issue #2015 Fix typo in event loop explanation
1 parent 0b2b29c commit e343fdb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/snippets/js/s/event-loop-explained.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Does the output look like what you expected? Let's break down what's happening,
9393
7. The Event Loops has finished its current Task, evaluating the script. It then begins running the first Microtask in the Microtask Queue, which is the callback of `Promise.prototype.then()` that was queued in step 5.
9494
8. `console.log()` is pushed to the Call Stack and executed, logging `'Promise.then() #1'`.
9595
9. `Promise.prototype.then()` is pushed to the Call Stack and executed. This creates a new entry for its callback function in the Microtask Queue.
96-
10. The Event Loop checks the Microtask Queue. As it’s not empty, it executes the first Microtask, which is the callback of `Promise.prototype.then()` that was queued in step 10.
96+
10. The Event Loop checks the Microtask Queue. As it’s not empty, it executes the first Microtask, which is the callback of `Promise.prototype.then()` that was queued in step 9.
9797
11. `console.log()` is pushed to the Call Stack and executed, logging `'Promise.then() #2'`.
9898
12. Re-rendering would occur here, if there was any.
9999
13. The Microtask Queue is empty, so the Event Loop moves to the Task Queue and executes the first Task, which is the callback of `setTimeout()` that was queued in step 3.

0 commit comments

Comments
 (0)