freeCodeCamp/guide/english/certifications/javascript-algorithms-and-d.../basic-javascript/add-new-properties-to-a-jav.../index.md

32 lines
451 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Add New Properties to a JavaScript Object
---
## Add New Properties to a JavaScript Object
Here's the example:
```js
var ourDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": ["everything!"]
};
ourDog.bark = "bow-wow";
```
Here's a solution:
```js
var myDog = {
"name": "Happy Coder",
"legs": 4,
"tails": 1,
"friends": ["freeCodeCamp Campers"]
};
// Only change code below this line.
myDog.bark = "woof";
```