Intro to functions #12


#1

This seems correct to me, but the output keeps saying SyntaxError: expected expression, got keyword 'else'
here is the 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))

Thank you, and any help is very valuable.


#2

your if statement is missing a {, here is what i mean:

if (condition){ /* you miss {  */

your function is missing a closing curly bracket (}) and semi-colon after your else statement, you are missing semi-colons after console.log. I think that was all