What is JavaScript
JavaScript is a programming language that executes on the browser. It turns static HTML web pages into interactive web pages by dynamically updating content, validating form data, controlling multimedia, animate images, and almost everything else on the web pages.
JavaScript is the third most important web technology after HTML and CSS. JavaScript can be used to create web and mobile applications, build web servers, create games, etc.
JavaScript Example
JavaScript can be used in various activities like data validation, displaying popup messages, handling events of HTML elements, modifying CSS, etc. The following sample form uses JavaScript to validate data and change the color of the form.
The responsive UI and menu of this website is also using JavaScript. There is no website in this world that does not use JavaScript or JavaScript-based frameworks.
JavaScript History
In early 1995, Brendan Eich from Netscape designed and implemented a new language for non-java programmers to give newly added Java support in Netscape navigator. It was initially named Mocha, then LiveScript, and finally JavaScript.
Nowadays, JavaScript can execute not only on browsers but also on the server or any device with a JavaScript Engine. For example, Node.js is a framework based on JavaScript that executes on the server.
JavaScript and ECMAScript
Often you will hear the term ECMAScript while working with JavaScript. Let's clear the confusion before it arises.
As you now know, JavaScript was primarily developed to execute on browsers. There are many different browsers from different companies. So, there was a need to standardize the execution of the JavaScript code to achieve the same functionality in all the browsers.
Ecma International is a non-profit organization that creates standards for technologies. ECMA International publishes the specification for scripting languages is called 'ECMAScript'. ECMAScript specification defined in ECMA-262 for creating a general-purpose scripting language.
JavaScript implements the ECMAScript standards, which includes features specified in ECMA-262 specification as well as other features which are not based on ECMAScript standards.
There are different editions of ECMAScript. Most browsers have implemented ECMA-262 5.1 edition.
- ECMA-262 5.1 edition, June 2011
- ECMA-262, 6th edition, June 2015
- ECMA-262, 7th edition, June 2016
- ECMA-262, 8th edition, June 2017
- ECMA-262, 9th edition, June 2018
- ECMA-262, 10th edition, June 2019
JavaScript Engine
JavaScript engine interprets, compiles, and executes JavaScript code. It also does memory management, JIT compilation, type system, etc. Different browsers use different JavaScript engines, as listed in the below table.