Functions & if / else


#1

I dont find what is wrong in this...
// Write your function below.
// Don't forget to call your function!

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);
thanks


#2

The only thing I can think of is putting a space between if and (num.
Try it, tell me if it works.


#3

didnt work out, still unresolved.


#4

Fixed, here is the fixed solution.
function sleepCheck(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);