712 Views
ve written at length about some of the new features coming to JavaScript with ES6, including arrow functions, classes, modules and destructuring. Today I'd like to explore some of the smaller additions, starting with new methods that are being added to arrays. This isn't a comprehensive list, rather a selection of some that I've found really useful. Rather that list compatability information here about what is and what isn't supported across transpilers and browsers, you should refer to the relevant section of the Kangax compat table. Paul Miller's ES6 Shim includes polyfills for a number of the methods I'm going to mention today, too. All code examples below were run through Babel. We'll start with methods defined on the prototype before looking a couple of new static Array methods.