12. Functions&If/else


#1


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

SyntaxError: Unexpected end of script

Hi. Can anybody help me to understand what is wrong with my code?

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!";
    }
    console.log(sleepCheck(10));
    console.log(sleepCheck(5));
    console.log(sleepCheck(8));


#2

Your function is missing a closing curly brace "}"


#3

I think your function has no name, it only have a parameter .......


#4

No, the function is named sleepCheck and it has a parameter of numHours.


#5

it worked! thanks a lot!)


#6

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