12. Functions&If/else



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!";


Your function is missing a closing curly brace "}"


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


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


it worked! thanks a lot!)


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