12. Functions & if / else


#1

Whats the problem?! it says unexpected token else...

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


#2

Remove the semi colon after the numHours check here,


#3

perfect! I was focusing on the else part -_- didnt even notice that
THANKS


#4

You're welcome. :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.