Javascript was created to be event-driven because it relies on the actions (events) of users to carry out specific codes. Javascript is used to create forms, respond to clicks, and submit data to programs. Each of these events require a response. This can be best explained through the lens of a website like Amazon. Amazon is a very interactive website which uses many functions. In order to search items, users must click the search button. This is an event that requires a response. All of the data under that search will be pulled up and made accessible to the user. Also, in order to purchase an item, users must put items into their cart, enter their name, address and credit card info, and choose a chipping method. These actions are all events that codes must respond to. These codes are very complex because they must have the proper reaction to each user event.
Reader Interactions
Comments
Leave a Reply
You must be logged in to post a comment.
Kristina Brown says
I like that you mention Amazon as an example of how JavaScript is event-driven. It allowed me to understand the importance of JavaScript and how it helps websites function. It definitely shows the complexity of coding as well
Brittany Robinson says
Hi Rachel. I like how you gave us example on how JavaScript works using Amazon. Gives us a better understanding on how it operates. Thank you for that explaination.