Help! Keep receiving "Syntax Error:Unexpected Token {" when calling sleepCheck function


I've checked the syntax several times and still seem to be getting this error message - possible about an extra curly bracket? Any help is appreciated. Thanks.

var sleepCheck=function(numHours) {
if (numHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
else(numHours <= 8) {
return "Get some more shut eye!";


You have a condition on else where you shouldn't have one.


Ok @ainsleighb else is not suppose to have a conditon. This is how the conditons go..

if (This Happenes(Evaluates to true)){
//Do This....
//Do that

So just erase the conditon of else statements. Docs about conditonal statements is here (for more info). Hope this helped!


Just an issue of "trying to make things more complicated than they actually are". Thanks!