Event Loop Flashcards
What is the JavaScript Event Loop?
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.
What is different between “blocking” and “non-blocking” with respect to how code is executed?
“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.