JavaScript is Out of This World!
What it means to be event-driven.

First announced in 1996 and scheduled to launch in 2021, the James Webb Space Telescope is poised to fundamentally alter our understanding of the universe. The JWST “will be a large infrared telescope with a 6.5 meter primary mirror” that promises to be “the premier observatory of the next decade, serving thousands of astronomer’s worldwide” by peering deep into space to find light “from the first luminous glows after the Big Bang, to the formation of solar systems capable of supporting life on planets like Earth, to the evolution of our own Solar System.¹ ” With nearly 25 years in development, and a price tag of $9.5 Billion, what terrestrial programming language could possibly be trusted with the herculean task of operating such a behemoth?
JavaScript, of course!

But why JavaScript?
Brent Noorda, who led the development team that created the telescope’s JavaScript interpreter, explained “…the way I remember thinking about it was when your system is running a million miles away, you can’t send an IT tech to press CTRL-ALT-DEL when something goes wrong.² ” JavaScript, with its event-driven nature, became the obvious choice to handle such a situation.
What does it mean to be event-driven?
In the context of the JWST, JavaScript’s event-driven behavior means that “commands execute one after another based upon the prior command’s execution status as opposed to a ground-calculated execution time, thus improving execution efficiency. There is also the capability to skip commands when the required resource is not available or when a prerequisite event does not take place.³ ” Down here on Earth, it means that we can put clicky buttons in our apps and webpages .

Events set JavaScript apart
JavaScript has the ability to stay in memory and only execute certain code in case of an event, without having to run a bunch of other code with it. This eco-system allows our pages to load and, unlike other languages, keep listening for a user event such as a button-click, scroll, hover or keystroke.
Handling an event is as easy as calling a function
When the user triggers the event, or action, the event listener fires up and executes a corresponding function known as the event handler ⁴

Conclusion
In short, JavaScript’s event-driven nature makes our apps more intuitive and explicit. Whether here on Earth or a million miles away, JavaScript is able to call functions and check to see if some conditions are satisfied before sending commands allowing for user-driven behavior and the ability to account for breaks or bugs in other parts of our code — truly out of this world!