JavaScript: Map.prototype.entries
New in JS2015.
mapObj.entries ( )
-
Return a Iterable Object for the map instance mapObj.
Each yield is a array of the form
[key, value]
.Map.prototype.entries
is the same asMap.prototype[Symbol.iterator]
[see Symbol Tutorial]. This means, map object itself is already iterable using exactly the same iterator. So this method is redundant.console.log(Map.prototype.entries === Map.prototype[Symbol.iterator]);