Help me, I don't know whats wrong


#1

I got this so far. I don't know whats wrong. Any help will be appreciated.
// 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);


#2

you've got some syntax errors:

shouldn't have the + in there.

the end of the function should have a ;

also, your code is a bit hard to read - but that might be just the way it appears when you cut and paste. Here's what I ended up with for the var:


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!";
    }

};

#3

Thanks, that helped a lot! I can now advance on my learning.