GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing www.geeksforgeeks.org — JavaScript Map Reference - GeeksforGeeks JavaScript Map ReferenceLast Updated : 23 Jul, 2025 JavaScript Map is a collection of elements where each element is stored as a key, value pair. Map objects can hold both objects and primitive values as either key or value. When we iterate over the map object it returns the key, and value pair in the same order as inserted. You can create a JavaScript Map by:
Passing an Array to |
Constructor | Description |
|---|---|
| Map() | Create Map objects in JavaScript. |
JavaScript Map Properties: A JavaScript property is a member of an object that associates a key with a value.
| Instance Properties | Description |
|---|---|
| constructor | It is used to return the constructor function of Map. |
| size | Return the number of keys, and value pairs stored in a map. |
JavaScript Map Methods: JavaScript methods are actions that can be performed on objects.
Static Methods | Description |
|---|---|
| clear( ) | Removal of all the elements from a map and making it empty. |
| delete() | Delete the specified element among all the elements which are present in the map. |
| entries( ) | Returning an iterator object which contains all the [key, value] pairs of each element of the map. |
| forEach() | The map with the given function executes the given function over each key-value pair. |
| get( ) | Returning a specific element among all the elements which are present in a map. |
| has( ) | Check whether an element with a specified key exists in a map or not. |
| keys() | The keys from a given map object return the iterator object of keys. |
| set() | Add key-value pairs to a Map object. |
| values() | Return a new Iterator object that contains the value of each element present in Map. |