Need help on 12


#1



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


#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