Syntax error


#1


Syntax error


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

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)
sleepCheck (5)
sleepCheck (8)


#2

closing curly braces (}) of if and else shouldn't have semi-colons, remove the semi-colons

then make sure that the strings you return are an exact match, copy them from the instructions. return doesn't need to have parentheses.


#3

You stated it like this

When in an if statement there should be only one semicolon, at the end.

if (a > b) {
//something
} else {
//something
};

#5

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