12. Functions - SyntaxError: Unexpected token else


could someone please help me out with where i went wrong with the syntax

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



There is never a semi-colon before else, otherwise it is treated as a new statement, and statements do not begin with else.


understood, thanks for the response!


2 posts were split to a new topic: Not working please help