如何使用 JavaScript/JQuery 创建一个简单的映射
2022-08-30 01:25:27
如何创建与此 Java 代码等效的 JavaScript/JQuery:
Map map = new HashMap(); //Doesn't not have to be a hash map, any key/value map is fine
map.put(myKey1, myObj1);
map.put(myKey2, myObj2); //Repeat n times
function Object get(k) {
return map.get(k);
}