I get this error: "Oops, try again. It looks like sleepCheck() isn't returning "You're getting plenty of sleep! Maybe even too much!" when numHours is 10. Check your if / else syntax and whether you're using the correct comparison operator." On this part of the lesson:

// Write your function below. 
// Don't forget to call your function!
function sleepCheck(numHours){
  if(numHours >= 8){
    return 'You\'re getting plenty of sleep! Maybe even too much';
  } else{
    return 'Get some more shut eye!';

I can see all the messages in the console


Remove the backslash in you're. When you use apostrophes in your text strings, you have to put the entire text inside quotation marks to avoid syntax errors.


They probably haven't factored in escaping as part of a possible solution, so you can't use it in this exercise.

But brownie point to you and keep up the good work!


I had it with double quotes first, and it didn't work. Tried single quotes, didn't work. Went back to double quotes still doesn't pass. But I'm getting all the messages correctly in the console. You don't see anything else? cause I don't.


Thanks, but the backslash isn't the problem. I tried it with double quotes first, then single.


even i am facing the same problem


You didn't add an exclaimation mark to the end of "much".


I'm also facing the similar problem here, take a look at my codes, I really don't know what the problem is. And if I remove the '{' from the 'return' statement I then get the error about the 'else' token. I'm really confused. I've tried in anyway but nix.

var sleepCheck = functions (numHours) {

if (numHours <= 8) {

return "You're getting plenty of sleep! Maybe even too much"; }

else {
return "Get some more shut eye!"; }



Add an exclamation point after "too much", refresh the page and submit.


You're a star buddy, thanks so much! It worked this time.