Map
Introduction
Section titled “Introduction”A Map is a collection of key-value pairs where keys can be any type (objects, functions, primitives). Unlike objects, Maps preserve insertion order and have a size property.
Learning Objectives
Section titled “Learning Objectives”- Create and manipulate Map collections
- Understand Map vs Object differences
- Use Map methods: set, get, has, delete, clear
- Iterate over Maps with keys(), values(), entries()
- Know when to use Map vs Object
Topics Covered
Section titled “Topics Covered”| Topic | Description | Est. Time |
|---|---|---|
| Map Methods | set, get, has, delete, clear | 15 min |
| Map vs Object | Key differences and when to use each | 15 min |
| Iteration | keys(), values(), entries(), forEach | 10 min |
| WeakMap | Garbage-collectable Map alternative | 15 min |
Prerequisites
Section titled “Prerequisites”- Objects and how they work
- Basic understanding of key-value collections
Learning Path
Section titled “Learning Path”Map Methods → Map vs Object → Iteration → WeakMap