10IMPROVED ARRAY CAPABILITIES

image

The array is a foundational JavaScript object. But while other aspects of JavaScript have evolved over time, arrays remained the same until ECMAScript 5 introduced several methods to make them easier to use. ECMAScript 6 continues to improve arrays by adding a lot more functionality, such as new creation methods, several useful convenience methods, and the ability to make typed arrays. This chapter walks you through those changes in detail.

Creating Arrays

Prior to ECMAScript 6, the two primary ways to create arrays were the Array constructor and array literal syntax. Both approaches required listing array items individually ...

Get Understanding ECMAScript 6 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.