Babel
We have been using babel for some time now. Since we have started using it, we don't have to struggle with unimplemented features of ECMAScript. In this regard, JavaScript is JavaScript, no matter what browser you are using. We strongly recommend using Babel or similar solutions (e.g. TypeScript).
Babel gives you the possibility to use the latest features from JavaScript (ECMAScript) in the browser of your choice.
Without Babel you had to use the feature set of your oldest browser or use feature detections such as modernizr or write polyfills on your own.
In general, Babel is split in 2 ways to bring you the new goodies you want.
New syntax will be compiled to old EcmaScript 5 code e.g.:
New globals and functions are provided by babel-polyfill e.g.:
The configuration is really simple due to the plugin system. You can choose which ECMAScript version and stage presets you want to use.
- for the latest ECMAScript version use babel-preset-env
- for version 2015 only use babel-preset-2015
To know what you need you can practice ECMAScript 6 by doing it with es6katas and ask caniuse.
If you are using TypeScript, Babel is not necessary since you already get the new features with TypeScript.