Map Map Object
Last updated: 2026-09-09
Map Map Object
Map is a key-value collection with any-type keys. Maintains insertion order.
| Category | Collections |
|---|---|
| ES version | ES1 |
📝 Syntax
const map = new Map();
map.set('key', 'value');
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
Zhang
2
💡 Tip Map keys can be any type.
ℹ️ info Map iterates in insertion order.
🏷️ Related Items
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
QMap vs object?
AMap keys any type; object keys strings/Symbols.
QHow to iterate?
Afor (const [k, v] of map).
QMap vs WeakMap?
AWeakMap keys are weak objects.