ES6 Preface
Hiya! And welcome to this weekly series about the upcoming new ES6 features! ES6 is coming to your local browser and thats awesome news! Hopefully you agree, otherwise let me convince you in the next few weeks. ES6 contains lots of features which will change the way you will write JavaScript in the future. In the next weeks we will pick one feature after another and have a deeper look inside, comparing it to ES5 and having some examples how to use them.
This series is more for the rookies and ABCdarians in JavaScript, as we will not cover the full mechanics behind, having “simple and easy” examples, but will provide enough insights to fully use the power of ES6.
Table of Contents
- ES 1..2..3.. ..5..6, what?
- Features of 3rd and 5th edition
- What´s in store for ES7?
- Can i use ES6 right now?
ES 1..2..3.. ..5..6, what?
ES6 is an abbreviation for ECMAScript-262 Standard Edition 6. You maybe have seen others like ECMAScript2015 or the Codename “Harmony”. Its a standardized core of the Javascript language developed by Brendan Eich around 1995 while he was working for Netscape.
There have been 4 other Editions of JavaScript over the last 20 years, the last (ES5) being released 2009. You may ask why only 4, its ES6! Yep you´re right, but ES4 was dropped as too ambitious and finally the standard committee stopped working on it and agreed on the relatively modest ES5.
What does ECMA international say about the development of JavaScript?
ECMAScript usage has moved beyond simple scripting and it is now used for the full spectrum of programming tasks in many different environments and scales. As the usage of ECMAScript has expanded, so has the features and facilities it provides. ECMAScript is now a fully featured general propose programming language.
Features of 3rd and 5th edition
In the third edition of the Standard (ES3) powerful regular expressions
, better string handling,
new control statements
, try/catch exception handling
and several other features were introduced. It was published in 2002.
ES5 (2009) introduced the most substantial upgrade for this language.
It introduced (or lets say finally formally specified) among other things:
- Object.create()
- Object.defineProperty( obj, prop, desc )
- Object.keys( obj )
- Object.getOwnPropertyNames( obj )
- strict mode
- getters & setters
- Array.map() .filter() .isArray etc.
- Function.prototype.bind ( thisArg )
and they stated in their introduction
ECMAScript is a vibrant language and the evolution of the language is not complete. Significant technical enhancement will continue with future editions of this specification.
and they have kept their word.
What´s in store for ES7?
There are already proposals for the next edition of ECMAScript, even before ES6 was published. And a 2-year release cycle for the standard is proposed (good news after waiting 6 years for ES5…).
On this Github-Page you can have a first impression.
Current proposals involve:
- Array.prototype.includes( element ) returning true/false whether an array includes a certain element
- Object.observe( obj, observer ) which allows for direct observation of changes to objects
- SIMD (Single Instruction Multiple Data) which will speedup 3D Graphics and Physics as well as Image/Video Processing
Can i use ES6 right now?
As you can see on Kangax´ compatibility table lots but not all features are supported by only up-to-date browsers (Firefox excels here). If you want to safely use almost all of ES6´ features, without having to twiddle too much with this table, you can make use of Babel or Google´s Traceur-transpiler (translator and compiler).