Basic JavaScript - Delete Properties from a JavaScript Object

they keep telling me to You should not modify the

var ourDog = {
name: “Camper”,
legs: 4,
tails: 1,
friends: [“everything!”],
bark: “bow-wow”
};

delete ourDog.bark;

// Setup
var myDog = {
name: “Happy Coder”,
legs: 4,
tails: 1,
friends: [“freeCodeCamp Campers”],
bark: “woof”
};

// Only change code below this line.
delete myDog .tails;

var ourDog = {
  name: "Camper",
  legs: 4,
  tails: 1,
  friends: ["everything!"],
  bark: "bow-wow"
};

delete ourDog.bark;

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

// Only change code below this line.
delete myDog .tails;

Your browser information:

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

Challenge: Basic JavaScript - Delete Properties from a JavaScript Object

Link to the challenge:

Why do you have two objects? Reset and only add the deletion code.

Also, there shouldn’t be a space between the object name and the property where you use delete

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