I'm stuck please help!


#1

This is the excercise i'm stuck on:
https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661#

This is the error message the console is giving me:
SyntaxError: Unexpected token if

This is how my code looks:
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)

Please Help Thanks:3


#2

You need curly brackets around your function body.


#3

Could you give me an example i don't really understand what you mean.


#4

After this add a {


#5

And after the else bracket add one more on a new line with a semi colon

};


#6

Thank you very much.


#7

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