We’ve been throwing around the term ES6 since our very first lessons, but we haven’t taken the time to properly explain what it means or to investigate the implications of it in our code.
You have probably also come across articles talking about features in ES7 or ES8 or ES2015 or ES2017 etc. Part of the confusion here is that right after the release of ES6, the committee that makes these decisions changed the naming scheme from ‘version numbers’ (ES5, ES6, ES7 etc.) to ‘release years’ (ES2015, ES2016, ES2017 etc.)
- This article provides a nice clean explanation and timeline of the various ECMAScript releases.
- This document outlines all the new features that showed up in ES6. As we’ve mentioned you’ve already been using many of these, though there are a few we haven’t specifically covered yet.
For most of us, this has not been an issue because you are almost definitely using a new browser that automatically updates itself when a new version is released. But in the real world, if you’re selling products to customers you can’t control which browsers people will use to connect to your site.
- Follow the instructions here to install the babel-loader and use it with webpack. If you’ve already got webpack up and running in a project, adding babel is a cinch!
- Read this article to better understand presets and plugins in Babel. It will also show you how to target specific browser versions you want to support.