But to keep ourselves up in the race we must start using ES6 features today as just learning & waiting for it to be supported across all major browsers will not help.
A good news that this specification comes up with is that we already have few features available under experimental support given by browsers like Google Chrome & some of them we were using already.
To make the support ready today, we need a tool called as transpiler. A transpiler converts code from one syntax form to another. Thus using a transpiler we can convert code written in JS v6 to JS v5, making us able to start writing code in ES6 syntax using new features without worrying about the browser support.
There are some transpilers already available, here are a few:
- ES6 Module Transpiler
One that looks most promising as of date is Babel with detailed documentation & tutorials.
There are many transpilers and CLI tools available but most of them are not complete & are under development.
Addy osmani provides a detailed list here:
Babel allows you convert your JS6 code into JS5 syntax in their try it out editor.
Below is screenshot showing conversion of an example of rest parameters.
In my current project I am using features like classes & de-structuring, by converting the code using try it out link. A CLI tool can facilitate this in a better way.
References & further read: