Map()
The Map() constructor creates Map objects.
Syntax
new Map()
new Map(iterable)
Note:
Map()can only be constructed withnew. Attempting to call it withoutnewthrows aTypeError.
Parameters
iterableoptional- : An
Arrayor other iterable object whose elements are key-value pairs. (For example, arrays with two elements, such as[[ 1, 'one' ],[ 2, 'two' ]].) Each key-value pair is added to the newMap.
- : An