const. The only question is: how do you know which of the three to choose for any given situation? Well, let's talk about it.
functionkeyword, you'll still get an enormous amount of usage out of this new syntax.
name = name || 'Joe'). Luckily, with ES6, it'll all just work the way you'd expect. Even better, you're not limited to primitives alone; you can even set the default value equal to the result of a function call!
Objectadditions. In this episode, we'll review three of my favorites: property shorthand, short methods, and object destructuring.
In the previous lesson, we learned about Rollup. But, now, let's switch over to Webpack, which has a much larger community and plugin ecosystem. We'll set up a Webpack config file, transpile ES2015, and even peek at Laravel Elixir 6.0's seamless Webpack integration.
View the completed setup for this lesson on GitHub.
ES2015 brings a number of new additions to arrays, however, you'll likely only make use of a few of them. In this episode, we'll review the new
includes methods - with the latter actually being part of ES2017, not ES2015.
Setis an object that contains a collections of unique values of any type. Whether you simply want a cleaner API for working with this sort of structure, or need to enforce a unique constraint on all items within your collection,
Sets are the way to go.