Number 12 Functions and If/Else


#1

Sorry I know this has already been discussed but I really don't understand what I am doing wrong. Here is my code below. I have also noticed that people have been calling the functions differently, just wondering if thats the problem as i have done what the instructions explicitly said for that part : Call the function with 10 hours of sleep, like this: sleepCheck(10);

Many Thanks,

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

Replace this line with your code.

`


#2

HI first this line you should remove the ;

var sleepCheck = function(numHours); <== this one

then your if and else statement should be inside the sleepCheck function

var sleepCheck = function(numHours) {#open the sleepCheck function

#here put yout if and else statement

}#close the sleepCheck function

#3

Thank you very much, do you not need to use semi colons are the curly braces, just wondering ?

Many Thanks


#4

You could find more about semi colon on that topic