JavaScript in the browser uses an event-driven programming model. Everything starts by following an event. An event-driven application is a computer program written to respond to actions generated by a user or system. Javascript was created to react when a user does an action. An example of events is if you scroll up or down or if you click a button. This will cause for the JavaScript code to react and respond. JavaScript not only reacts to events but it maintains a list of events that happened. It will loop through the lists and calls on functions to connect the events taking place. JavaScript has a runtime model based on an event loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks. This model is quite different from models in other languages like C and Java. I think it’s pretty cool to learn why JavaScript is event-driven programming and not object oriented.
https://medium.com/@bojanaleksa/why-is-javascript-event-based-9c0fd9ac1033
Hi Sheree! I was shocked when learning how many sites use Javascript without you even realizing it. I always knew Javascript was one of the biggest programs and the most well-known by name, but after really looking into it, it’s crazy to actually understand what Javascript really does. When doing the assignment that required us to learn more about Javasripts and the coding used, I thought it was interesting to see all the functions that go into making successful code.