Collections

A collection is an object that stores multiple elements as a single unit. ES6 introduced various new collection objects to provide better ways of storing and organizing data.

The array was the only collection object available in ES5. Now we have ArrayBuffers, SharedArrayBuffers, Typed Arrays, Sets, and Maps, which are built in collection objects.

Let's explore the different collection objects provided in JavaScript.

Get Learn ECMAScript - Second 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.