Number 12 Functions and If/Else


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


Replace this line with your code.



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


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

Many Thanks


You could find more about semi colon on that topic