Microsoft Edge & ECMAScript 6

Lohith Goudagere Nagaraj takes you through a quick tour of why he feels ES6 is one of the biggest enhancements in JavaScript.

Published Date
18 - Sep - 2015
| Last Updated
23 - Sep - 2015
 
Microsoft Edge & ECMAScript 6

As a web developer, ES6 looks promising and exciting for me. Things that were of much need have found a place in JavaScript specification now. Here are some of promising ES6 features:

-    Constants

Allows you to define variables whose values will be constant and cannot be changed.

-    Block Scoped Variables & Function

Variable/functions scopes will now be within the block where they have been defined.

-    Arrow Function

Pretty similar to Lamba expressions in C#. A more expressive closure syntax

-    Template Strings

String interpolation in JavaScript for single line & multi line strings. 

-    Modules

Ability to modularize your code through different module.

-    Classes

Intuitive OOP Style classes comes to JavaScript now.
Complete specification of eS6 can be read here.

ES6 support in Microsoft Edge:

ES6 is certainly one of the largest update to JavaScript that will happen so far.At this moment, as of writing this article, Edge supports most of the 2015 features and scores high on the ES6 compatibility table.

EDGE Score on ES6 Compat Chart

Features ready to use are arrow functions, enhanced object literals, template strings, rest parameters, let & const support, proxies, symbols, iterators, Typed Arrays, Map, Set, WeakMap, WeakSet, new methods on String, Array, Number, Object & Math.

Experimental ES6 features in Microsoft Edge:

As stated above certain features are already available out of the box and are turned on by default. But there are certain features which are built but as an experimental feature & can be turned on by accessing the flags in MS Edge. Open flags mode by typing “about:flags” in the address bar. Enable check box titled “Enable experimental JavaScript features”. 

JavaScript Experimental Flag in Edge

ES6 Roadmap for Microsoft Edge:

Microsoft Edge scores high on the ES6 compat chart as seen above and the score is sure to increase in due course of time. Microsoft has an official status site where one can find out what’s supported out of the box in Edge and what is planned as a roadmap. You can access the site here. Technical Committee or TC as they are called as, have embarked on a cadence or release cycle of Yearly mode for ES specifications. What this means is TC will now meet and publish the specification yearly and this matches the release cadence of Edge. 

Using ES6 in Production:

Although ES6 is cool, it’s still a long way to go when all browser vendors including Microsoft are ready with 100% support. Currently you cannot go mainstream with ES6 as all browsers do not support ES6 completely. Thanks to Transpilers – a JavaScript Transformation Compilers - you can code in ES6 and Transpilers spit out ES5 code for you. Remember the JavaScript we write today adheres to ES5 standards. So the Transpilers spit ES5 code from your ES6 code which is required version to run on the browsers. Once ES6 goes mainstream you can then remove the transpilation step in your build and use the ES6 code directly on the browsers.  Some of the popular Transpilers tools are TypeScript, Babel and Traceur.

We are all excited about the way Modern Web is shaping up. So rush to get a free assessment of your website and see you on the other side.

Click here to check if your website adheres to interoperable web standards and is ready for various modern browsers, including Microsoft Edge