x
 
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Map 对象</h1>
<h2>new Map() 构造函数</h2>
<p>从数组创建一个 Map:</p>
<p id="demo"></p>
<script>
// 创建一个 Map
const fruits = new Map([
  ["apples", 500],
  ["bananas", 300],
  ["oranges", 200]
]);
let x = fruits.get("apples");
document.getElementById("demo").innerHTML = "fruits 中苹果的数量是 " + x;
</script>
</body>
</html>