Event Loop Flashcards

1
Q

What is the JavaScript Event Loop?

A

The event loop watches the call stack and event queue and when the call stack is cleared, the event loop pushes the next function in the queue to the call stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is different between “blocking” and “non-blocking” with respect to how code is executed?

A

“Blocking” refers to the blocking of further operation until the current operation finishes. Executed synchronously - the program is executed line by line. The program waits until the called function or the operation returns.

“Non-Blocking” refers to the program that does not block the execution of further operations. Executed asynchronously - the program may not necessarily execute line by line. The program calls the function and move to the next operation and does not wait for it to return.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly