JS: Map.prototype.entries
(new in ECMAScript 2015)
mapObj.entries()-
- Return a Generator for the map.
- Each yield is a array of the form
[key, value].
Map.prototype.entriesis the same asMap.prototype[Symbol.iterator]- 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]);