My code works but I am getting error message


#1



https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661

The code works perfectly. It prints the correct dialogue into console. However, i am getting this message and i can't continue the course:
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.

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

console.log(sleepCheck(10));


#2

@jozsefrealtyyahoo.co

When we say call a function, we don't want to log it in the console. We want to call it. Like this:

functionName(optional parameter);

#3

The spelling is off. You put "You are getting plenty of sleep!" when the question wants "You're getting plenty of sleep!"


#4

That was also an error, not the one they were asking about, but still worth mentioning. Thank you.


#5

It worked, thanks a lot! All these time i was busy looking for syntax error.....