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 ...
9. Maps and Sets
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.