“Memperbarui properti objek” Kode Jawaban

JavaScript: memperbarui properti objek


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

// Update the name value
myDog.name = "Happy Coder";
Outrageous Ocelot

Memperbarui properti objek

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"]);
Owlthegentleman

Memperbarui Properti Objek JavaScript

$.extend(true, skillet.person, {
  name: {
    first: 'updated'
  },
  birthday: {
    day: 'updated',
    year: 'updated'
  }
});
Jinal_Patel

Jawaban yang mirip dengan “Memperbarui properti objek”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya