Skip to content

Commit 84a81ea

Browse files
authored
contents: clarify that event loop is not exclusive to browsers (#12)
1 parent e4726bc commit 84a81ea

File tree

1 file changed

+2
-2
lines changed
  • questions/what-is-event-loop-what-is-the-difference-between-call-stack-and-task-queue

1 file changed

+2
-2
lines changed

questions/what-is-event-loop-what-is-the-difference-between-call-stack-and-task-queue/en-US.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ subtitle: What is the difference between call stack and task queue?
55

66
## TL;DR
77

8-
The event loop is concept within the browser runtime environment regarding how asynchronous operations are executed within JavaScript engines. It works as such:
8+
The event loop is concept within the JavaScript runtime environment regarding how asynchronous operations are executed within JavaScript engines. It works as such:
99

1010
1. The JavaScript engine starts executing scripts, placing synchronous operations on the call stack.
1111
2. When an asynchronous operation is encountered (e.g., `setTimeout()`, HTTP request), it is offloaded to the respective Web API or Node.js API to handle the operation in the background.
@@ -29,7 +29,7 @@ We recommend watching [Lydia's video](https://www.youtube.com/watch?v=eiC58R16hb
2929

3030
## Event loop in JavaScript
3131

32-
The event loop is the heart of JavaScript's asynchronous operation. It is a mechanism in browsers that handles the execution of code, allowing for asynchronous operations and ensuring that the single-threaded nature of JavaScript engines does not block the execution of the program.
32+
The event loop is the heart of JavaScript's asynchronous operation. It is a mechanism that handles the execution of code, allowing for asynchronous operations and ensuring that the single-threaded nature of JavaScript engines does not block the execution of the program.
3333

3434
### Parts of the event loop
3535

0 commit comments

Comments
 (0)