Problem in question : Updating Object Properties

What is required of this question::

Since he’s a particularly happy dog, let’s change his name to “Happy Camper”. Here’s how we update his object’s name property:

ourDog.name = "Happy Camper"; or

ourDog["name"] = "Happy Camper";

Now when we evaluate ourDog.name , instead of getting “Camper”, we’ll get his new name, “Happy Camper”.

Update the myDog object’s name property. Let’s change her name from “Coder” to “Happy Coder”. You can use either dot or bracket notation.

He gave me this code :

// Example
var ourDog = {
“name”: “Camper”,
“legs”: 4,
“tails”: 1,
“friends”: [“everything!”]
};

ourDog.name = “Happy Camper”;

// Setup
var myDog = {
“name”: “Coder”,
“legs”: 4,
“tails”: 1,
“friends”: [“free Code Camp Campers”]
};

// Only change code below this line.

You have added the following code ::

myDog.name = “Happy Camper”;

//myDog[“name”] = “Happy Camper”;

And still gives me that there is a mistake !!
What is the solution?

Update the myDog object’s name property. Let’s change her name from “Coder” to “Happy Coder”

1 Like

Wonderful
Thank you very much