Once upon a time in California, a talented computer scientist named Brendan Eich wrote a brand new programming language. The legend wants that his creation took about 10 days of work and it was called ‘Mocha’.
- adding new HTML to a page or updating existing code
- updating styles
- reacting to actions triggered by the user (like mouse events and key presses)
- using AJAX to make requests over a network
- in addition to dealing with the local storage (getting and setting cookies)
- and many more.
More precisely, an engine read (‘parses’) the script that we, as developers, write. The script is converted (‘compiled’) into machine language that will run.
There are several different engines out there, but the most famous are:
- V8 used in Chrome and Opera
- SpiderMonkey used in Firefox
- ChakraCore used in Microsoft Edge