SleepCheck (Yes another one)


#1


What did I do wrong? I cant get past this exercise


Error Messages:

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.

But the console did display correctly!


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 exercise wants us to just call the function, without printing it out in the console.

Even though you are correct, that's what the exercise is trying to get us at.


#3

need a space between sleep! and Maybe


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.