Explica este c贸digo JavaScript
Dificultad: B谩sico
驴Cu谩l es la manera correcta de llamar a un getter?
class Dog {
#peso;
constructor({ color, tamanio, peso=10, cola=true}){
this.color = color;
this.tamanio = tamanio;
this.#peso = peso;
this.cola = cola;
}
get getIsCola(){
return this.cola ? "Si tiene cola" : "No tiene cola"
}
}
const boby = new Dog({
color: "cafe",
tamanio: "grande"
});
console.log(boby.getIsCola); //A
console.log(boby.getIsCola()); //B
A. A
B. B
C. Ninguna de las anteriores
Respuesta en el primer comentario.