the-event-loop Flashcards

1
Q

What is the JavaScript Event Loop?

A

it’s job is to look at the stack and task queue; if the stack is empty it takes the first thing in task queue and pushes it onto the stack, which runs it. It has to wait until the stack is clear before it can push onto the 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 executes synchronously while non-blocking executes asynchronously; blocking prevents other code from running until stack is empty/complete

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