Map
noun
say it: “MAP” /mæp/
A JavaScript collection that stores values under keys of any type, keeps them in the order added, and looks them up quickly.
What is Map in JavaScript?
Map — A collection that associates unique keys with values.
const prices = new Map();
prices.set("tea", 3);
In a sentence
- “A Map can use an object as a key, which a plain object can't.”
- “The cart keeps each item's quantity in a Map, keyed by product id.”
Level: Freelancer · More JavaScript terms at this level
Updated