3 javascript libraries in 5 minutes and 45 secondes
fernan_s
11.9K views
Babel.js
What is Babel ?
Babel is a compiler which translates JavaScript code from a newer version of JavaScript to an older version in order to maximize browser compatibility. It can load newer syntaxes like ES2015 or ES7 and transpile them to older versions like ES5 or even ES3.
In this playground, you can see how easy it is to setup Babel by simply editing the configuration in package.json and .babelrc files.
The JavaScript file below contains ES2015 syntax so you can see the result of the translation to ES5, produced by Babel.
ES2015 to ES5
.babelrc
is a configuration files and takes many different properties, such as options to ignore certain files. Check out the documentation on babelrc.
For more information on Babel, follow this link.
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Suggested playgrounds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Test {
constructor() {
this.params = arguments;
}
Method() {
console.log("call ES2015 method");
}
getSortedParamById() {
this.params.sort((a, b) => a.id - b.id);
return this.params;
}
}
1
{
1
{