JavaScript Map.prototype.entries() Method
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
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.
Desktop





Tablets & Mobile





