12 function if/else


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
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!