📜  附加到地图 javascript 代码示例

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

代码示例1
var myMap = {};

myMap[newKey] = newValue;

// ...


// Another method

var myMap = new Map()
myMap.set("key0","value")
// ...
myMap.has("key1"); // evaluates to false, assuming key1 wasn't set