ECMAScript 6 and new array functionalities

As you learned in Chapter 1, JavaScript – A Quick Overview, the JavaScript language has new functionalities according to the ECMAScript 2015 (ES6 or ES2015) and newer specifications (2015+).

The following is a list of the new methods added in ES2015 and ES2016:

Method

Description

@@iterator

Returns an iterator object that contains the key/value pairs of the array that can be synchronously called to retrieve key/value of the array elements.

copyWithin

Copies a sequence of values of the array into the position of a start index.

entries

Returns @@iterator, which contains key/value pairs.

includes

Returns true if an element is found in the array, and false otherwise. This ...

Get Learning JavaScript Data Structures and Algorithms - Third Edition 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.