Im stuck and i cant find out why!


#1

var sleepCheck = function(numHours)

if(numHours >= 8)
{
return "You are getting plenty of sleep! Maybe even too much!";
}
else
{
return "Get some more shut eye!";
};
sleepCheck(10);

Help please!


#2

I am sure you are missing curly brackets { } from the function


#3

You also need to do sleep check on 5 and 8 hours

sleepCheck(5);
sleepCheck(8);


#4

I did that after i posted this, sorry, i have this now

var sleepCheck = function(numHours){
if(numHours >= 8){
return ("You are getting plenty of sleep! Maybe even too much!");
}
else{
return ("Get some more shut eye!");
}};
sleepCheck(10)
sleepCheck(5)
sleepCheck(8)


#5

Not sure if you're mean't to use return or console.log, but you're also missing the semicolons after each sleepCheck.

Correct me if I'm wrong and its asking you to use return but this is working for me in jsbin.

var sleepCheck = function(numHours){
if(numHours >= 8){
console.log("You are getting plenty of sleep! Maybe even too much!");
}
else{
console.log("Get some more shut eye!");
}};
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);

#6

Thanks, i finally worked out what was wrong, i didnt put You're, i put You are instead! thanks again!