Unexpected token if


#1

I have no idea what I have done wrong. it all looks right to me... :weary:

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!";
}
var sleepCheck(10);
var sleepCheck(5);
var sleepCheck(8);


#2

add an opening and closing bracket for your function

var sleepCheck = function(numHours) { //Add this opening bracket
  if (numHours >= 8){
    return "You're getting plenty of sleep! Maybe even too much!";
  }
  else {
    return "Get some more shut eye!";
  }
}; //Add this closing bracket!