JavaScript Map Reference
New to JavScript Maps?
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() | Invokes a callback for each key/value pair in a Map |
get() | 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 |