Getting error but can't find the issue in the code


So if I run the code it works but I get the following error message "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." and I am unable to proceed to the next lesson. The if/else statements work just fine when the value of numHours is adjusted when the function is called. Please Help me figure out what I'm doing wrong. Thanks in advance.

var sleepCheck = function(numHours){
    if(numHours >= 8){
        return "You're getting plenty of sleep! Maybe even to much!";
    }else {
        return "Get some shut eye!";


Make sure your text strings exactly match what the exercise calls for. Then make sure you call your function with the parameters the instructions ask for.


I copied and pasted the correct returns and it worked just fine so I must have missed something. Thanks for your help!


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