I really like Airbnb’s coding standards and as I’ve been trying to master ES6 (also named EcmaScript 2015) I’ve found that they offer many helpful hints on how to use ES6 functionality. Further, its really useful when learning to play around with the syntax and see what the equivalent is in ES5, in order to see what is and is-not possible. One of the best ways of doing that is using babel js’ REPL environment.
So, I’ve created a set of links which open examples from the coding standards in babel, so you can see what the examples compile to and try editing the examples to learn more. I’ve also included links against each section to the MDN or other documentation which explains what is happening in more depth.
If you’d prefer to try out the code in the browser, check out the kangax compatibility table to see which browser you might be able to try something in.
References 2.3 -
Objects 3.7 - Object literal shorthand property name.
Destructuring 5.3 - Object vs Array destructuring assignment.
Functions 7.8 - Default parameters.
Functions 8.2 - Arrow functions.
Constructors 9.2 - Classes.
Constructors 9.3 - Classes.
Constructors 9.4 - Classes.
Modules 10.2 - Modules.
Modules 10.3 - Modules.