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

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

代码示例4
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"]);