Lesson 12 if/else


#1



I don't know what's wrong.
Keeps saying, "Oops, try again. There was a problem with your syntax."

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


#2

Hi you didn't closed the function sleepCheck()


#3

Thanks, that worked.


#4

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

and I've got this: 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.

Can you help me?


#5

Hi try to refresh the page.


#6

Hi, nevermind I found the mistake in my string and solved it.
Thanks btw