Explica este c贸digo JavaScript
Dificultad: Intermedio
const perro = {
id:1,
color:"negro",
cola: false
}
const DEFAULT_OBJ = {
id: "sin id",
color: "default",
nombre: "sin nombre",
cola: "-"
}
const getPerro = (obj) => {
return {
...DEFAULT_OBJ,
...obj
}
}
console.log(getPerro(perro))
A.
{
id:1,
color: "negro",
cola: false
}
B.
{
id:1,
color: "negro",
nombre: "Boby",
cola: false
}
C.
{
id:1,
color: "negro",
nombre: "sin nombre",
cola: false
}
D. Ninguno de los anteriores
Respuesta en el primer comentario.