To put it simply, Javascript is considered “event-based” because it reacts to an event! The main purpose of java is for someone to constantly be taking action, and not for the program to close but to keep responding to the actions. For example, just scrolling down a common page that view, Java sits and waits for your actions, whether you type something in a search bar, or even click and highlight a specific area. This is java reacting to an event! So every time you do something on a web browser that creates this event, and java will then react, and do the action in which you intended. On top of that, java will also maintain a list of these events as well, this is called an event queue. The event queue is set up where the first element to enter is also the first one to leave. Java script is considered event-based because it is a coding language that reacts to events as they occur.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
I like how you took it a step further and even mentioned the event queue in your explanation. Shows you understand the material.
Hello Robert,
Great post, I agree we know that because JavaScript we can interact with almost everything on the internet. This is how we create websites and apps, when looking at what it takes to create these interactions, we have to first understand JavaScript relationship between it. As you said JavaScript sits and waits for actions to be taken, one taken JavaScript will react to it creating these events. JavaScript is a coding language that is in everything we interact with, whether it be a website or this discussion post, once we click it will do the job it was programmed to do. I also like how you talked about event queues which contain stored data and memory, and it follows the FIFO method which means first in first out. Great job talking about how JavaScript is considered event based as well as talking about event queues.