12. there's a problem with my syntax


#1

Same issue, but it says there's a problem with my syntax. Help?

var sleepCheck = function (numHours) {

if (numHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
};

else (numHours < 8) {

return "Get some more shut eye!";

};
console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));


12 Oops Try again
12 Oops Try again
#2

There are 2 problems, first you miss a closing } for the function and secondly you need to be careful with semicolons when dealing with condition. Have a look at this for a longer explanation:


#3

I need help! I don't know what I am doing wrong! any suggestions?
Thank You
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));


#4

@jenna_young should open your own question