<!DOCTYPE html> <html> <body> <h1>JavaScript Map 对象</h1> <p>由数组创建 Map:</p> <p id="demo"></p> <script> // 创建 Map const fruits = new Map([ ["apples", 500], ["bananas", 300], ["oranges", 200] ]); document.getElementById("demo").innerHTML = fruits.get("apples"); </script> </body> </html>