Function if&else-Error message


SyntaxError: Unexpected token =

I am not sure why is not working. I also really not knowing how this curly bracket working, please help what is wrong about my coding for this function?

Replace this line with your code. 

// Write your function below. 
// Don't forget to call your function!

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


your function declaration syntax is off, take a look here if you need a syntax refresher


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.