ES6
Intro
JavaScript has had many new features added to the language in the last 3 years. These changes are collectively called ‘ES6’, and provide convenient new ways to write better code. (As a side note, new revisions of the JavaScript language are released every year. ES6 is technically ES2015, ES7 is ES2016, etc.)
Suggested Learning
- Focus on the following:
let
(block-scoped variables) andconst
(constants)- Arrow Functions (
() => {}
) - Classes
- Destructuring
- Template Literals
- ES6 Features
- More explanation
- BabelJS - Because not all web browsers support the latest JavaScript features, you have to “transpile”, or convert your ES6 JavaScript to syntax which older browsers can use. Some features, like Promises, can’t be transpiled and require what is called a ‘Polyfill’. Polyfills replicate functionality of new features using older-style code. Babel is an incredibly powerful tool, and this blog post explains why Babel matters. You’ll learn how to use Babel in your projects in the Tooling requirement.
Requirements
- Fork this codepen and do your work in it.
- Change the JavaScript settings to use Babel as the preprocessor. This will make it so your ES6 code is executable.
- Follow the instructions on the Codepen to demonstrate the features on ES6.
- Show your work to the
#requirements
Discord channel to show you have passed this requirement off.
Extra Learning
This list is by no means complete. Feel free to add an issue or put in a pull request to update it.