Looping Eternally Onward, or… Java Scripts Event Loop

This is in reference to the talk found at:

I hadn’t gotten deep enough into Java Script to even begin to ask the questions that this presentation started giving me some rather great answers for. Java Scripts ability to add reactive elements onto a browser page was always fascinating, but never technically puzzling and I don’t really know why it didn’t occur to me to ponder how.

Seeing the visualizations in the video helps illustrate how the webAPI inclusions in the browser enable JavaScript to have keep a list of off-stack event queues that can trigger onto an off-stack function call list. All of which is managed by the event loop itself which is a process that checks if nothing is happening(current stack clear), and if so checks if anything wants to happen(event waiting on queue)… then makes a matchup if the stars align.

Introducing the idea of the browser render as another constant-queue waiting for a stack slot as well further illuminated how the responsive nature of the browser is generated. Overall I rate this video a “Yeah, pretty solid watch.”