Lesson 12 Functions & if / else STUCK PLEASE HELP


#1

12 Functions & if / else

I can't figure out what is wrong with this code. Can someone please help?
This is the error I keep getting:
"Oops, try again. It looks like your function doesn't return "Get some more shut eye!" when numHours is 5. Check your if / else syntax and whether you're using the correct comparison operator."


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


#2

shut is misspelled, strings returned should be an exact match


#3

There are two curly brackets at the end?


#4

one to close off the function and one to close off the else statement


#6

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