12. Functions & if\else


My code not working.


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


your if condition:

if (sleepCheck >= 8)

you shouldn't compare with the function name, you should compare with the function parameter which holds the number of hours of sleep


Thankyou. I dont know how i forgot that.