#12 Help!


#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!";
}
}
sleepCheck(10));
sleepCheck(5));
sleepCheck(8))

I'm stuck on level 12, I have looked through like EVERY forum post and haven't been able to figure out what I'm doing wrong, it says unexpected token ), pls help.



#2

see unexpected token )

sleepCheck(10));
sleepCheck(5));
sleepCheck(8))


#3

I thought i had tried that before, obviously not, well done me. Thx for the help though :smiley:


#4

you can do like this too

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


#5

ah okay, thx for the help


#6

actually your problem was here

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

it should be " >="

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


#7

I ended up changing that to before your first reply


#8

:yum: So i got that to