What is ECMAScript & how is it different from JavaScript?

What is ECMAScript & how is it different from JavaScript?
What is ECMAScript & how is it different from JavaScript?

Many a time as a beginner, people may get confused by the terms JavaScript and ECMAScript or ES, and often use them interchangeably. But are they really the same or not? If they are not the same, then what do they mean by exactly and how are they related to each other?

This blog will delve into the details about what exactly is ECMAScript and how it differs when compared to JavaScript. In the year 1995, JavaScript was created by the developer Brendan Eich of Netscape (a web browser company which was popular in the earlier days). It was initially named as Mocha, then it was later changed to the name LiveScript and finally, it got its name changed to JavaScript. This happened possibly due to marketing reasons since Java was a very popular programming language and hyped in those days.

Later in the year 1997, there was a need for standardisation of scripting languages to avoid disputes and confusion between various concerned parties and promote compatibility among different browsers. This standard of scripting languages like JavaScript and JScript (which was another scripting language, developed by Microsoft for their browser Internet Explorer) is known as ECMAScript.

ECMA is an abbreviation for European Computer Manufacturer’s Association. While both the scripting languages, JavaScript and JScript strive to follow the guidelines of ECMAScript specifications, they also come with supplementary features which are not given in the specifications.

It has several naming conventions. For example, ECMAScript 5 is shortened further as ES5 and also known as ECMAScript 2009. From the year 2015 onwards, ECMAScript is named by the year (ECMAScript 2015). So, ECMAScript 6 is called as ECMAScript 2015 and also popularly as ES6. JS is considered to be one of the most popular implementations of ECMAScript.

There is a committee called TC39 (stands for Technical Committee number 39) at the ECMA International organisation which governs the updates and changes which are done to it. When a proposal for a new update is sent to the ECMA, it has to go through a series of stages. They are namely, Stage 0 – Strawman (the ideation stage), Stage 1 – the proposal stage, Stage 2 – the drafting Stage, Stage 3 – the candidate stage (feedback) and finally the Stage 4 – the finished stage.

How are they different: ECMAScript vs JavaScript

As we have already discussed above, JavaScript is a scripting language that conforms to the ECMAScript specifications. ECMAScript is a programming language in itself, specified in the document ECMA-262 which is the specification of the programming language. When we read the ECMAScript specification, we learn how a scripting language must be created and the rules it must abide by, whereas when we read the documentation of JavaScript, we learn how to use or write code in the scripting language.

So, we can summarise it as follows – ECMAScript specification lays it out on how a particular feature should be implemented, then the JavaScript or any other scripting language that complies with the ECMAScript standards will implement that particular feature and lastly it is the developer who codes in JavaScript language based on how the particular feature is implemented by the target browser.

Earlier some browsers like the Internet Explorer were implementing a few of the features in a different manner. But, due to this standardisation of scripting languages, all the browsers are supporting the same syntax. This makes the code compatible with all the browsers which would not have been possible without the standardisation process.

The ES5 or the ECMAScript 2009 version brought many new functionalities like the strict mode which is helpful to programmers since the JavaScript as a language is very forgiving in nature (e.g. It compensates for missing semicolons in sentences of the code) which may cause run time errors and silly mistakes that are hard to debug later. Other than that, JSON support was added to ECMAScript.

Also, the Array iteration methods, String.trim() method, and Array.isArray() method got added to it. The ES6 or the ECMAScript 2015 was very popular for bringing major updates and new features to the existing version. Some features that were added to it were the keywords ‘let’ and ‘const’. Also, Default parameter values were added. They also added the functions Array.findIndex() and Array.find() to it.

blog banner 1

The ECMA-262 document does not refer to web browsers, whereas it defines the various parts like keywords, syntax, operators, global objects, types, reserved words and statements of the language. So, we can say ES is not tied to browsers.

Conclusion
So, as we have discussed above, we can conclude that ECMAScript serves as the standard for scripting languages and JavaScript is a popular programming language that conforms to the ECMAScript specifications.

To explore more topics on web development, click here.

By Shifani Ram