Map API

The Map global object is a constructor for Map objects. Map objects are collections of key-value pairs where both the keys and values can be of any value.

14 Total 11 Methods 3 Properties 2 Statics
  Show all

new Map(…)

Creates a new Map object.Map.Map([iterable])

[Symbol.iterator]()

Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order.m[Symbol.iterator]()

[Symbol.toStringTag]

The initial value of the @@toStringTag property is the String value "Map".m[Symbol.toStringTag]

clear()

Removes all key-value pairs from the Map object.m.clear()

delete(…)

Removes the specified element from a Map object by key.m.delete(key)

entries()

Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order.m.entries()

forEach(…)

Calls callbackFn once for each key-value pair present in the Map object, in insertion order.m.forEach(callbackFn, [thisArg])

get(…)

Returns the value associated to the key, or undefined if there is none.m.get(key)

has(…)

Returns a boolean indicating whether an element with the specified key exists or not.m.has(key)

keys()

Returns a new Iterator object that contains the keys for each element in the Map object in insertion order.m.keys()

Map.prototype

The prototype of the Map constructor.Map.prototype

set(…)

Sets the value for the key in the Map object. Returns the Map object.m.set(key, value)

size

Returns the number of key/value pairs in the Map object.m.size

values()

Returns a new Iterator object that contains the values for each element in the Map object in insertion order.m.values()

clear()

method

Removes all key-value pairs from the Map object. m.clear()

You seem to be offline. App may not work.