<!DOCTYPE html>
<html>
<body>
<h2>JavaScriptマップオブジェクト</h2>
<p>Map.forEach()の使用</p>
<p id="demo"></p>
<script>
// 地図を作成する
const fruits = new Map([
["apples", 500],
["bananas", 300],
["oranges", 200]
]);
let text = "";
fruits.forEach (function(value, key) {
text += key + ' = ' + value + "<br>"
})
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>