I wanted to do that if you have a child it is true to show me something, to do it but not inside a class and if it is false tell me that you do not have children, I made this churro but it does not go, this._hijos is true you should enter the if no to the else but it's not going, could someone help me? Thanks
class Persona{
constructor(nombre, apellido, edad, cm, hijos, celiacos){
this._nombre = nombre;
this._apellido = apellido;
this._edad = edad;
this._cm = cm;
this._hijos = hijos;
this._celiacos = celiacos;
}
presentacion(hijos){
if (hijos) {
return 'Hola mi nombre es ' + this._nombre + ' y tengo ' + this._edad + 'años, ' + 'mido ' + this._cm + ' cm ' + ' y tengo hijos';
} else {
return 'Hola mi nombre es ' + this._nombre + ' y tengo ' + this._edad + 'años, ' + 'mido ' + this._cm + ' cm ' + ' y no tengo hijos';
}
}
gritar(volumen = ' a un volumen desconocido'){
console.log(this._nombre + ' ha pegado un grito' + volumen)
}
}
let amigo1 = new Persona('ivan', 'garcia lopez', 33, 185, true, true)
let amigo2 = new Persona('Fran', 'Manrique', 33, 185, false, true)
console.log(amigo1.presentacion());
amigo1.gritar(' a un volumen estratosferico')
amigo2.gritar();