Lesson 12 unexpected else token


#1

I've put the code as well as the image of my screen.

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

I am rather confused. please help someone.


#2

Just delete semi-colons after curly brackets on lines 6 and 9.


#3

The semicolon ends your logic, remove it and it should work fine.


#4

thank you that worked.