Functions & If\Else Help! Logic seems fine


#1


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

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're getting                  plenty of sleep! Maybe even             too much!";
        }
    else
        {
         return "Get some more shut eye!";
        }
};

sleepCheck(10);


#2

Make sure your strings are exact match to those given in the instructions. There seems to be some extra white space in the first one.


#3

Thank you mtf. By copying and pasting the exact string from the instructions resolve me issue. I was trying to keep everything lined up but didn't realize white space causes issues. Thank again.