JavaScript: Updating Object Properties 1

JavaScript: Updating Object Properties

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

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

Here is what the above code is Doing:
1. We create a variable named myDog and assign it to an object.
2. We then access the name property of myDog and assign it a new value “Happy Coder”.

Similar Posts