© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
J. SimpsonHow JavaScript Works https://doi.org/10.1007/978-1-4842-9738-4_9

9. Maps and Sets

Jonathon Simpson1  
(1)
Belfast, Antrim, UK
 

While objects and arrays are the most common way of storing data in JavaScript, they do have some limitations. For example, neither objects nor arrays have the ability to create a unique list without duplicates. Similarly, objects cannot contain keys that are not strings or symbols. To overcome these challenges and more, two additional special types of objects exist known as maps and sets. Both of these have unique functionality, which makes them well-suited to certain tasks. In this chapter, we’ll be diving into both of these ...

Get How JavaScript Works: Master the Basics of JavaScript and Modern Web App Development 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.