---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Map()

The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects.

## Syntax

```js
new Map()
new Map(iterable)
```

> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx).

### Parameters

- `iterable` _**optional**_
  - : An `Array` or other
    [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) 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
    new `Map`.
