What is ECMAScript?
Sunday, October 2nd, 2016 by Servage
ECMAScript is something you must have heard a lot recently if you are a front-end developer. It is becoming more and more widely used, there are multiple versions of it and new versions make JavaScript better and easier to write. But what exactly is ECMAScript? Let's find out!
History of ECMAScript
Originally, JavaScript was created for Netscape. The goal of the language was to allow writing code similar to Java but making it easier to learn. There used to be multiple versions of JavaScipt, such as Microsoft's JScript. When Internet Explorer gained more popularity, Netscape quickly lost its user base. During that time, a new standard called ECMAScript was created with the intent to standardize the current and future versions of JavaScript.
ECMAScript was a relatively unknown standard for a long time, but the fifth version, released in 2009, made the standard more popular.
Relation and differences with JavaScript
So if ECMAScript is the standard, what is JavaScript then? JavaScript is an implementation or dialect of ECMAScript. There are other dialects as well, such as ActionScript, which is used for Flash programming. JavaScript takes the features from ECMAScript and turns it into code that can be run inside a web browser. This is the crucial difference between them. ECMAScript only defines what features are available in a language that implements it.
Coding with ECMAScript
If you have had a look at the most recent ReactJS code, you may notice some weird-looking syntax like arrow functions and constants that look like this: const App = () => {}. This is not typical JavaScript, and because web browsers only understand JavaScript, the code cannot be run inside a web browser directly. Code written in the latest ECMAScript syntax must go through a compilation process. This means converting ECMAScript into traditional JavaScript so that web browsers can understand it.
As of today, web browsers support most of the features of ECMAScript 5. However, ECMAScript 6, also called ES6 or ES2015, is already available to developers. The conversion process is necessary because JavaScript engines found in web browsers do not support the newest features of ECMAScript immediately as new features are introduced. They are brought into JavaScript and web browsers at a later time. However, developers can still use those features and compile the new ECMAScript code into older JavaScript version that is supported by web browsers.
New versions of ECMAScript allow developers to take advantage of new and useful features before they are implemented in JavaScript. This is why ECMAScript syntax is commonly used when working with modern JavaScript applications.
A Brief Recap
To sum everything up, ECMAScript defines the features of all languages that use the specification, and JavaScript is an implementation of it that runs inside a web browser. To use the latest version of ECMAScript before they are supported by browsers, you can write code using the latest syntax and convert it into an older version of JavaScript.
What is ECMAScript?, 5.0 out of 5 based on 5 ratings
Creating cool animated typing effects
Beautiful date range picker for Bootstrap
CSS sprites are cool and useful
Create .zip files with JavaScript dynamically
Using DOM elements in Javascript – Part 4
Categories: Software & Webapps, Tips & Tricks
Keywords: javascript