Skip to main content
JavaScript

ECMAScript and JavaScript – don’t get confused !

By January 23, 2022July 20th, 2022No Comments
ECMAScript and JavaScript

People often get confused between ECMAScript and JavaScript. ECMA which is short for European Computer Manufacturer’s Association, is an international organization that creates standards for technologies. One of these standards is called “ECMA-262”. ECMA-262 is the standard for creating a general purpose scripting language. This standard is commonly called ECMAScript specification. This specification contains rules and guidelines for creating a scripting language. JavaScript which is a client-side scripting language is one of the major implementations of the ECMAScript Specification. Other implementations include Jscript and ActionScript. The committee that works on the ECMAScript specification is called TC39 (Technical Committee number 39).

ES (ECMAScript) followed by a number, references the specific version of ECMAScript, for example ES1, ES2 etc. So far there are 10 versions of ES from ES1 to ES10. ES.Next references the next upcoming version of ES.

 Except for ES1 and ES2, each version of ES introduces a new set of features to the language. For example, regular expressions and try/catch exception handling were added to ES3. Whereas ES6 additions include arrow function expressions, const and let keywords, and more.

 Therefore, JavaScript continually evolves, with yearly additions post ES6.  We will explore major ES updates such as arrow functions, map, sets, and so on, of each version in this interview guide. It is important to know what features are available for you to use rather than memorizing what ES version they belong to.

Yearly ES additions allow browser vendors and developers to implement features at a constant rate.

Each browser uses a different JavaScript engine.  V8 is Chrome’s JavaScript engine, Firefox uses SpiderMonkey and Chakra is Internet Explorer’s JavaScript engine. Each browser adopts the latest ES features at different rates. Therefore, when working with the latest ES features you can:

1. Check browser support for a specific feature

2. Transpile your code

 To check browser support for a particular ES feature you may use https://www.caniuse.com. The website provides a table of browsers and their versions that support a particular feature that is searched for.

In order to ensure that the code that you write works on all browsers, it is common to transpile your JavaScript code.  Transpiling translates your JavaScript code from one version to a previous ES version. This in turn allows you to use the latest ES features that haven’t been implemented uniformly across all browsers. A common transpiler is called Babel https://www.babeljs.io). Babel is used to convert ES6 and onwards code into a backward compatible version so that it may run on older browsers as expected.

Leave a Reply