let obj = {age:18}
obj[name] = 16 // ''
obj['name'] = 16 //添加属性
obj.age = 19; //修改属性
console.log(obj)//{age: 19, "": 16, name: 16}
//变量字符串化
for (var prop in obj) {
console.log(prop); // prop不再是变量 转化为obj["prop"]
}
;