📜  节点映射具有价值 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:18.701000             🧑  作者: Mango

代码示例1
let myMap = new Map();

myMap.set("key1", "value1");
myMap.set("key2", "value2");

console.log(myMap.has("key1")); // true
console.log(myMap.has("key2")); // true

console.log(myMap.get("key1")); // value1
console.log(myMap.get("key2")); // value2

// NOTE: DO NOT try to access map values using [].
// myMap["key1"] = "value1";