2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Add New Properties to a JavaScript Object
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Add New Properties to a JavaScript Object
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
---
|
|
|
|
## Solutions
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
```js
|
|
|
|
var myDog = {
|
2019-07-24 00:59:27 -07:00
|
|
|
name: "Happy Coder",
|
|
|
|
legs: 4,
|
|
|
|
tails: 1,
|
|
|
|
friends: ["freeCodeCamp Campers"]
|
2018-10-12 15:37:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
// Only change code below this line.
|
|
|
|
myDog.bark = "woof";
|
|
|
|
```
|
2019-07-24 00:59:27 -07:00
|
|
|
</details>
|