{"id":3821,"date":"2023-03-02T01:13:34","date_gmt":"2023-03-02T06:13:34","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=3821"},"modified":"2023-03-02T01:13:34","modified_gmt":"2023-03-02T06:13:34","slug":"why-is-javascript-event-driven-7a-2","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/why-is-javascript-event-driven-7a-2\/","title":{"rendered":"Why is JavaScript event-driven? &#8211; 7A"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3823\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/event-300x150.png\" alt=\"\" width=\"300\" height=\"150\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/event-300x150.png 300w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/event.png 318w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"background: whitesmoke\"><span style=\"font-family: Raleway;color: #666666\">JavaScript in the browser uses an event-driven programming model. Everything starts by following an event. An event-driven application is\u00a0a 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\u00a0<b>event loop<\/b>, 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\u2019s pretty cool to learn why JavaScript is event-driven programming and not object oriented.<\/span><\/p>\n<p style=\"background: whitesmoke;margin: 0in 0in .25in 0in\"><span style=\"font-family: Raleway;color: #666666\">\u00a0<\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"font-family: Raleway;color: #666666;background: whitesmoke\"><a href=\"https:\/\/flaviocopes.com\/javascript-events\/#:~:text=Introduction-,JavaScript%20in%20the%20browser%20uses%20an%20event%2Ddriven%20programming%20model,user%20types%20on%20the%20keyboard\">https:\/\/flaviocopes.com\/javascript-events\/#:~:text=Introduction-,JavaScript%20in%20the%20browser%20uses%20an%20event%2Ddriven%20programming%20model,user%20types%20on%20the%20keyboard<\/a>.<\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"font-family: Raleway;color: #666666;background: whitesmoke\">\u00a0<\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"font-family: Raleway;color: #666666;background: whitesmoke\"><a href=\"https:\/\/www.techtarget.com\/searchitoperations\/definition\/event-driven-application#:~:text=An%20event%2Ddriven%20application%20is,for%20system%20hardware%20or%20software\">https:\/\/www.techtarget.com\/searchitoperations\/definition\/event-driven-application#:~:text=An%20event%2Ddriven%20application%20is,for%20system%20hardware%20or%20software<\/a>.<\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"font-family: Raleway;color: #666666;background: whitesmoke\"><a href=\"https:\/\/medium.com\/@bojanaleksa\/why-is-javascript-event-based-9c0fd9ac1033\">https:\/\/medium.com\/@bojanaleksa\/why-is-javascript-event-based-9c0fd9ac1033<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; JavaScript in the browser uses an event-driven programming model. Everything starts by following an event. An event-driven application is\u00a0a 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 [&hellip;]<\/p>\n","protected":false},"author":29429,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[10531],"tags":[],"class_list":{"0":"post-3821","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-student-post","7":"entry"},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/users\/29429"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=3821"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3821\/revisions"}],"predecessor-version":[{"id":3824,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3821\/revisions\/3824"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=3821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=3821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=3821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}