Whats wrong with these code?


#1

Hi, I got stuck in 12. functions & if / else. Here is my code. It runs well. But still show the message

Woops! try again.It looks like sleepCheck() isn't returning.....

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

}

sleepCheck(10);
sleepCheck(5);
sleepCheck(8);

Whats wrong with it actually?


#2

remove the semicolons from your two return statements and try again. I haven't used JS in years but I looked up a JS function example on the WWW


#3

Instead of:

return"You're getting plenty of sleep! Maybe even too much!";

You put

check that exclamation mark. Also, put console.logs before your sleepChecks.