📌  相关文章
📜  JavaScript:更新对象属性 - Javascript 代码示例

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

代码示例3
var myDog = {
  "name": "Coder",
  "legs": 4,
  "tails": 1,
  "friends": ["freeCodeCamp Campers"]
};

myDog.name = "Happy Coder"
console.log(myDog.name);
//or
myDog["name"] = "Happy Coder"
console.log(myDog["name"]);