iterate through map javascript map keys code example
Example 1: loop through map in js
var myMap = new Map();
myMap.set("0", "foo");
myMap.set(1, "bar");
myMap.set({}, "baz");
for (const [key, value] of myMap.entries()) {
console.log(key, value);
}
Example 2: iteratea on values map js
map.values((value) => /* do whatever with value */)