Functions and If/else


#1

I am having a problem with this code. The interpreter keeps saying the following:

Oops, try again. It looks like your function doesn't return "Get some more shut eye!" when numHours is 5. Check your if / else syntax and whether you're using the correct comparison operator.

// Write your function below. 
// Don't forget to call your function!
var sleepCheck = function(numHours){
    if (numHours >= 8){
        return "You're getting plenty of sleep! Maybe even too much!";
    }
    else {
        return "Get some shut eye!";
        }
};
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);


#2

You're missing the word "more" in your shut eye string.


#3

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