Hi what's wrong here (Functions if/else statement)


#1

var sleepCheck = function (numHours)
if (numHours > = 8) {
return "You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);


#2

Hi Kaouche,

You forgot to open and close your sleepCheck function using curly braces ({}), and I think you need to remove the space between > and = on line 2.

Would you mind giving a link to the exercise this is on, please?
Thanks.


#3

Thanks Zystvan !
(I didn't understand the 2nd part of your question : link ? )


#4

@slibre2 No problem :)

Link; the URL of the exercise; where you type in website addresses, like https://www.codecademy.com. Could you copy that bit into the forum so I can see it please?


#5

Oh yes sorry ! So it is the N° 11 Function . But I found it . I m at the moment in N° 4 of the Game in JS . Very interesting !