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

The **`keys()`** method returns a new
_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object
that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used.

## Syntax

```js
keys()
```

### Return value

A new [Map](../../../globals/Map/Map.mdx) iterator object.
