var dic={A:"AA",B:"BB",C:"CC"} //不能length去for循环(length:undefined)
dic["D"]="DD"; //新增键值对
var tmp=dic["D"]; //通过key获取值
for (var key in dic) {
var item = dic[key];
console.log(item); //AA,BB,CC,DD
}
From:https://www.cnblogs.com/xuejianxiyang/p/10221930.html