1var myMap = new Map();
2myMap.set("0", "foo");
3myMap.set(1, "bar");
4myMap.set({}, "baz");
5
6for (const [key, value] of myMap.entries()) {
7 console.log(key, value);
8}
1const object = {'a': 1, 'b': 2, 'c' : 3};
2for (const [key, value] of Object.entries(object)) {
3 console.log(key, value);
4}