ES6 - Map Method entries()


Advertisements

Returns a new Iterator object that contains an array of [key, value] for each element in the Map object in insertion order.

Syntax

myMap.entries()            

Return Value

Returns a new iterator object.

Example

var myMap = new Map(); 
myMap.set("id", "admin"); 
myMap.set("pass", "admin@123"); 

var itr = myMap.entries(); 
console.log(itr.next().value); 
console.log(itr.next().value);  

Output

id,admin 
pass,admin@123   
es6_collections.htm
Advertisements