I think there is a bug on exercise 12 of functions


#1

Hey everyone, so I think this exercise has a bug. I don't believe I am doing anything wrong, yet it keeps telling me there is an error...can please someone help? If it is a bug, it's the 2nd time I encounter one since I started the JS module... :confused:

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

var sleepCheck=function(numHours){

       if (numHours >=8){
        return "You're getting plenty of sleep! Maybe even too much!";
    }
            else {
                
                return "Get some shut eye!";
            }
};
            
            console.log(sleepCheck(10));
            console.log(sleepCheck(5));
            console.log(sleepCheck(8));

#2

the error meassage is
It looks like your function doesn't return "Get some more shut eye!"

check the string carefully in your code

"Get some more shut eye!

you have to do same to same even a single sapce


#3

Wow...thank you! I was going insane! How could that have passed me by? I read it a million times! Argh!! thanks! :slight_smile:


#4

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