First Steps with Babel

Now that you have your tools installed and your files in place, it is time to get started with ES6.

For the moment, you will use Babel from the command line. Later, you will add it to your npm scripts so that compilation happens automatically. That way, as you work with new ES6 features you can focus on the new syntax without worrying about running extra commands in the terminal.

Class syntax

The first ES6 feature you will use for building the Chattrbox client is the class keyword. It is important to keep in mind that the ES6 class keyword does not work exactly like classes in other programming languages. Instead, ES6 classes merely provide a shorter syntax for constructor functions and prototype methods. ...

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.