bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/JavaScript/Working with Data
JavaScript•Working with Data

JavaScript Map Reference

Concept visual

JavaScript Map Reference

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Complete Map Reference

Revised July 2025

Method

Description new Map()

Creates a new Map object clear()

Removes all the elements from a Map delete() Removes a Map element specified by a key entries() Returns an iterator object with the [key, value] pairs in a Map forEach()

Formula

Invokes a callback for each key/value pair in a Map

Gets the value for a key in a Map groupBy() Groups object elements according to returned callback values has() Returns true if a key exists in a Map keys() Returns an iterator object with the keys in a Map set() Sets the value for a key in a Map size

Returns the number of Map elements values()

Returns an iterator object of the values in a Map

Learn More:

JavaScript Maps

JavaScript Map Methods

JavaScript Weak Maps

JavaScript Sets

Previous

JavaScript WeakSet

Next

RegExp Meta Characters