I am stuck.. please help! S.O.S if/else


#1

Hi everyone.. I am stuck in this exercise since yesterday. I would appreciate some help. I don´t know what´s wrong..
var controlDescanso= function(cantHoras){
if (cantHoras>= 8) {
return "¡Estás durmiendo suficiente!"+""+"¡Demasiado quizas!";
}
else
{
return "¡Cerrá los ojos un poco más!";
}
}
console.log(controlDescanso(10));
console.log(controlDescanso(5));
console.log(controlDescanso(8));


#2

What error does it give you?


#3

Try again. It seems that controlDescanso () does not return "¡Estás durmiendo demasiado"!
¡Demasiado quizás! " when cantHoras is 10. Controls the syntax if / else and if you're using the corresponding comparison operator .
Well, the message in spanish, this is the translation. I don´t get it.,because the coding is exactly the same that you guys are doing in english.


#4

This string which it seems to be expecting, is not what you are returning if the variable is greater than 8

Should it instead be this?

// You have replaced demasiado with suficiente!
if (cantHoras>= 8) {
return "¡Estás durmiendo demasiado"!¡Demasiado quizás! ";
}

A good tip to keep in mind is that you may also escape conflicting quotations with the \ character.
"¡Estás durmiendo demasiado\"!¡Demasiado quizás! "
There's no need to concat the string using +""+