--- title: Deepcopy id: 596a8888ab7c01048de257d5 challengeType: 5 videoUrl: '' localeTitle: Copia profunda --- ## Description
Tarea:

Escribe una función que devuelva una copia profunda de un objeto dado.

La copia no debe ser el mismo objeto que se le dio.

Esta tarea no probará para:

Objetos con propiedades que son funciones Objetos de fecha u objeto con propiedades que son objetos de fecha RegEx u objeto con propiedades que son objetos de RegEx Copia de prototipo
## Instructions
## Tests
```yml tests: - text: deepcopy debe ser una función. testString: 'assert(typeof deepcopy === "function", "deepcopy should be a function.");' - text: 'deepcopy({test: "test"}) debe devolver un objeto.' testString: 'assert(typeof deepcopy(obj1) === "object", "deepcopy({test: "test"}) should return an object.");' - text: No debe devolver el mismo objeto que se proporcionó. testString: 'assert(deepcopy(obj2) != obj2, "Should not return the same object that was provided.");' - text: 'Cuando se pasa un objeto que contiene una matriz, debe devolver una copia profunda del objeto.' testString: 'assert.deepEqual(deepcopy(obj2), obj2, "When passed an object containing an array, should return a deep copy of the object.");' - text: 'Cuando se pasa un objeto que contiene otro objeto, debe devolver una copia profunda del objeto.' testString: 'assert.deepEqual(deepcopy(obj3), obj3, "When passed an object containing another object, should return a deep copy of the object.");' ```
## Challenge Seed
```js function deepcopy (obj) { // Good luck! return true; } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```