Functions and if/else statement EDIT CODE


#1



Hi everyone! I am experiencing a "syntax error" message whenever I try to submit this lesson exercise. Could someone please review my code and edit it? I feel that I have been looking at it for too long, so I cannot see my mistakes. Thank you!


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


Replace this line with your code.


#2

the condition of if statement should be in brackets:

if (condition)

your brackets are missing


#3

Thank you!
I tried that and I still get the same message, "syntax error."


#4

please post an upadted version of your code


#5

You are also missing a }

You've closed your if/else statement, but not your function. There should be two }'s at the end.