Needing some help with 12/13


#1

Hi guys

Is there something wrong with my code that I am missing? Any help would be appreciated, cheers!

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!";
}


#2

First off, your whole segment is suppose to be inside a function (sleepCheck). And then you're suppose to call it with three different arguments (10, 5, and 8). Like so:

var sleepCheck = function(numHours) {
// If and else statement
}
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);

#3

Hi, thanks, I didn't realise it had to be inside the function.

I've tried putting it inside the function, like so, but I am still getting nowhere. Do i need to add another variable to call somewhere? Not really getting it.

I now have:
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);


#4

oh!

I was missing the closing }

seems to have done the trick.