Favorites

JavaScript Map.prototype.entries() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Map.prototype.entries()
JavaScript Map Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The entries() method returns an iterator of a Map's [key, value] pairs in insertion order. The keys() and values() methods return just the keys or values.

Description

The entries() method returns an iterator of [key, value] pairs. It's what for...of uses when you loop over a map directly. The related keys() and values() methods return iterators of just the keys or just the values; spread them into an array to use array methods.

The iterators are live: entries added to the map after the iterator is created are included if the iterator hasn't finished. Like all iterators, they can only be consumed once.

Iterator helper methods, such as map.entries().filter(...), let you process entries without first converting them to an array. To get a sorted list of entries, spread them into an array and call sort().

Syntax

map.entries()

Return Value

An iterator of [key, value] pairs.

Example

const m = new Map([['a', 1], ['b', 2]]);
console.log([...m.entries()]);
console.log([...m.keys()], [...m.values()]);
console.log(Object.fromEntries(m));

Browser Support

The following information will show you the current browser support for the Map.prototype.entries() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee