12 function if/else


#1



The error message say unexpected token else.
Please help.

// 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!"; 
    };
};


#2

The problem is the semicolons after the curly braces of if. See this link for a longer explanation what is happening:


#3

That worked. Thank You!