Build JavaScript Objects - Nothing Works

Tell us what’s happening:
Any help would be appreciated I’m so confused.

  **Your code so far**

const myDog = {
// Only change code below this line
var myDog = {
"name": "Benny",
"legs": 3,
"tails": 2,
"friends": ["Joe","Tyler"]
};

// Only change code above this line
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36

Challenge: Build JavaScript Objects

Link to the challenge:

look at your variable myDog and where it’s being defined twice

3 Likes

Thanks for the response. I tried removing each instance where it is defined and nothing is registering in the program still. Not too sure what the deal is but I’ll sit here as long as it takes.

You don’t need to remove both variable declarations of myDog.
Just one of them.

I would suggest reseting the lesson and only adding the key value pairs and nothing else.

Add your key value pairs in here

  // Only change code below this line
KEY VALUE PAIRS GO IN HERE

  // Only change code above this line

If you are adding another myDog in there, that is incorrect.

Hope that helps!

If you need extra help, take a look at the example code again.

const cat = {
  "name": "Whiskers",
  "legs": 4,
  "tails": 1,
  "enemies": ["Water", "Dogs"]
};

Notice they didn’t write this.

const cat = {
var cat = {
  "name": "Whiskers",
  "legs": 4,
  "tails": 1,
  "enemies": ["Water", "Dogs"]
}
};

Hopefully you can spot the difference between the correct answer and your answer. :grinning:

1 Like

If you are still failing after the good advice above, please post your most recent code that is not working.

Oh god it seems so obvious now… Thank you!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.