Help with Functions & if / else


#1


// Write your function below. 
// Don't forget to call your function!

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(8);
sleepCheck(10);


I am getting a error saying it is not getting returned?? Please help I have been on this for like a hour.


#2

We don't use parenthesis in return statements. Remove them and let me know if that solved it.


#3

no there is still something wrong with the ''else''


#4

got the else fixed now it is saying that it is not returning


#5

Does it say that nothing is being returned, or that the wrong thing is being returned?


#6

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