Need help on 12


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

```

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!”;
}
}
console.log(sleepCheck 10);
console.log(sleepCheck 5);
console.log(sleepCheck 8);

<do not remove the three backticks above>

#2

I don’t know what is wrong with my code


#3

Hi this part remove the ; after the if condition

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

#4

that don’t work it keeps saying SyntaxError: expected expression, got keyword ‘else’


#5

then add a { after the if condtion

if (numHours >=8) {

#6

it still says SyntaxError: expected expression, got keyword ‘else’


#7

and change your call function like that sleepCheck() so your code should be like that

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!";
    }
}
console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));

#8

Thank you for your help