Function If/Else


#1

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

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


Im not sure what is wrong. Although I have seen a lot of posts on it. Help. Tq.


#2

oh lol. I forgotten about return in the if else statement.


#3

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