Function if&else-Error message


#1



https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661


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!";
}; 
}
 sleepCheck(5);


#2

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


#3

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