Mastering JavaScript: Data Structures
Keyed Collections
Map
Overview
A Map object holds key-value pairs where keys can be of any type. Unlike objects, Maps maintain the insertion order of their elements.
Creating a Map
To create a new Map, use the Map constructor:
const map = new Map();
...
thedevfolks.com7 min read