Introduction to functions in JS, Functions & if/else statement


#1

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));

//This is my code and I got this error message: "Oops, try again. It looks like sleepCheck() isn't returning "You're getting plenty of sleep! Maybe even too much!" when numHours is 10. Check your if / else syntax and whether you're using the correct comparison operator."

Please help!


#2

You forgot an exclamation mark in, "Maybe even too much!".