12 help anyone


#1

Oops, try again. There was a problem with your syntax.

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

whats wrong? anyone?


#2

Hi,

I am facing the same issue here. In your case though, i see that you are missing a curly bracket "{" at the start of the function. I have used the curly bracket but still get the same error.

Thanks.


#3

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

So i ended up doing this and it worked! Thanks!