I don't know what's wrong


#1



https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661

Oops, try again. There was a problem with your syntax.
SyntaxError: Unexpected token else

Replace this line with your code. 
// Write your function below. 
// Don't forget to call your function!
var sleepCheck = function(numHours) {
    if (numHours >= 8);
    {
        return console.log("You're getting plenty of sleep! Maybe even too much!");
    }
    else (numHours < 8);
    {
        return console.log("Get some more shut eye!");
    }
    sleepCheck(10);
    sleepCheck(5);
    sleepCheck(8);


#2

HI this part remove the ; after the if condition

if (numHours >= 8); <== this one

then the else statement doesn't take any condition

if (condition) {
    #do something
}

else {
   #do something
}

#3

It still doesn't work


#4

can you post your new code?


#5

// Write your function below.
// Don't forget to call your function!
var sleepCheck = function(numHours) {
if (numHours >= 8)
{
return console.log("You're getting plenty of sleep! Maybe even too much!");
}
else
{
return console.log("Get some more shut eye!");
}
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);


#6

Now you forgot to close the sleepCheck() funtion

var sleepCheck = function() { #open the function sleepCheck()

#here put the if and else statement

} #close the function sleepCheck()

#7

Oops, try again. It looks like sleepCheck() isn't returning "You're getting plenty of sleep! Maybe even too much!" when numHours is 10. Check your if / else syntax and whether you're using the correct comparison operator.


#8

and here

return console.log("You're getting plenty of sleep! Maybe even too much!");

you have both return and console.log() remove console.log()


#9

Thank you very much.