event ∞ Flashcards
What is the JavaScript Event Loop?
responsible for executing the code, collecting and processing events, and executing queued sub-tasks
one job: look at stack and task queue
if the stack is empty, pushes whatever is on the task queue
first in, first out (FIFO)
What is different between “blocking” and “non-blocking” with respect to how code is executed?
Handling I/O is typically performed via events and callbacks, so when the application is waiting for something like a database query to return or an api request to return, it can still process other things like user input
blocking: ‘stack is full and waiting for processes”
nonblocking:
event loop is what allows Node.js to perform non-blocking I/O operations — despite the fact that JavaScript is single-threaded — by offloading operations to the system kernel whenever possible
what separates javascript from other languages?
Prototypal Inheritance, how this works, closures, and the event loop
what’s critical for modern web dev?
asynchronous programming
process
node/web -> callback queue (FIFO) -> event loop -> call stack (LIFO)