--- id: 56bbb991ad1ed5201cd392d2 title: Add New Properties to a JavaScript Object challengeType: 1 videoUrl: '' localeTitle: Agregar nuevas propiedades a un objeto de JavaScript --- ## Description
Puede agregar nuevas propiedades a los objetos JavaScript existentes de la misma manera que los modificaría. Así es como agregaríamos una propiedad de "bark" a ourDog : ourDog.bark = "bow-wow"; o ourDog["bark"] = "bow-wow"; Ahora, cuando evaluamos ourDog.bark , obtendremos su ladrido, "bow-wow".
## Instructions
Agrega una propiedad de "bark" a myDog y myDog con un sonido de perro, como "woof". Puede usar la notación de punto o corchete.
## Tests
```yml tests: - text: Agregue la propiedad "bark" a myDog . testString: 'assert(myDog.bark !== undefined, "Add the property "bark" to myDog.");' - text: No agregue "bark" a la sección de configuración testString: 'assert(!/bark[^\n]:/.test(code), "Do not add "bark" to the setup section");' ```
## Challenge Seed
```js // Example var ourDog = { "name": "Camper", "legs": 4, "tails": 1, "friends": ["everything!"] }; ourDog.bark = "bow-wow"; // Setup var myDog = { "name": "Happy Coder", "legs": 4, "tails": 1, "friends": ["freeCodeCamp Campers"] }; // Only change code below this line. ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```