Answers for "javascript map loop"

0

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);
}
Posted by: Guest on April-07-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language