It says "it looks like sleepCheck() isn't returning."


#1


  1. functions & if/else

    it says "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."

see my code below, i dont know whats wrong or maybe i did the console.log wrong?

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

the string returned should be an exact match, i recommend to copy it from the instructions. You forgot the exclamation mark after much(!)


#3

Thank you so much! I lost exactly exclamation mark and stuck here since yasterday evening)))


#4

it ain't matter ...
var sleepCheck = function(numHours)
{
if (numHours >= 8)
{
return "You're getting plenty of sleep! Maybe even too much!";
}

else
{
return "Get some more shut eyes!";
}
};
sleepCheck(10);
sleepCheck(8);
sleepCheck(5);
i have been doing this long but ain't helping me out


#5

A topic should be dedicated to helping the person who created the topic, i can understand that you use the topic to ask your own question, but that you then have exactly the same problem, is kind of frustrating. YOu have shut eyes instead of shut eye, in your else return statement


#6

Thank you good man :smiley: