Files

40 lines
591 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Delete Properties from a JavaScript Object
---
# Delete Properties from a JavaScript Object
2018-10-12 15:37:13 -04:00
### Hint 1
2018-10-12 15:37:13 -04:00
* change the properties of myDog by using dot notation
---
## Solutions
<details><summary>Solution 1 (Click to Show/Hide)</summary>
2018-10-12 15:37:13 -04:00
```javascript
var ourDog = {
name: "Camper",
legs: 4,
tails: 1,
friends: ["everything!"],
bark: "bow-wow"
2018-10-12 15:37:13 -04:00
};
delete ourDog.bark;
// Setup
var myDog = {
name: "Happy Coder",
legs: 4,
tails: 1,
friends: ["freeCodeCamp Campers"],
bark: "woof"
2018-10-12 15:37:13 -04:00
};
// Only change code below this line.
delete myDog.tails;
```
</details>
2018-10-12 15:37:13 -04:00