12. Functions & if/else Return Error


I keep getting this error:

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";
        return "Get some more shut eye!";

I don't know what I am doing wrong. Please help!


Compare your string to the above. They must match exactly.


You are so close to being right


Haha! Thank you. I feel silly now. Why is it always one character off? :stuck_out_tongue:


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