Maps – Basics
Creates a new Map, a built-in object that stores key-value pairs.
Understanding Maps – Basics in JavaScript
What it does: get() looks up the value stored for the "Sam" key. set() stores 30 under the key "Tom" in the ages Map. new Map() creates an empty Map ready to store key-value pairs. set() stores a value under the given key in the Map. JavaScript requires a capital M: new Map(). JavaScript is case-sensitive, so 'set' must be lowercase. set() takes the key first, then the value to store. set() adds this key-value pair to the Map.
Common mistakes: 'Map' must start with a capital M, not lowercase. 'set' must be lowercase - a capital S causes an error.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 41–52) and word search (Modules 21–52).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
new Map()Fill in the Blanks
Spot the Error
Student with a class code? Join your class →