Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Get Key/Values of Map

let map1 = new Map();
map1.set('name', 'Jack');
map1.set('age', '27');

// looping through the Map
for (let elem of map1.entries()) {
    console.log(`${elem[0]}: ${elem[1]}`);
}
 
PREVIOUS NEXT
Tagged: #javascript #Get #Map
ADD COMMENT
Topic
Name
4+3 =