<html>
<body>
<h1>JavaScript Maps</h1>
<h2>Map Destructuring</h2>
<p>Move array variables into single variables:</p>
<p id="demo"></p>
<script>
// Create a Map
const fruits = new Map([
["apples", 500],
["bananas", 300],
["oranges", 200]
]);
// Destructing
let text = "";
for (const [key, value] of fruits) {
text += "<p>" + key + " is " + value;
}
// Display the Values
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>