loop através do mapa em JS
const object = {'a': 1, 'b': 2, 'c' : 3};
for (const [key, value] of Object.entries(object)) {
console.log(key, value);
}
Alive Alligator
const object = {'a': 1, 'b': 2, 'c' : 3};
for (const [key, value] of Object.entries(object)) {
console.log(key, value);
}
let map1 = new Map();
map1.set('name', 'Jack');
map1.set('age', '27');
// looping through the Map
for (let values of map1.values()) {
console.log(values);
}