sleepCheck. My code isn't working I keep get an oops! statment


#1

My code isn't working. It's saying

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.

This is my code.

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

Please help.


#2

Hi found your problem it was just a typo you wrote

when it should have been "too" as in too much
also you should be using semicolons to end your return statements.
It should look like this
return "You're getting plenty of sleep! Maybe even too much!";


#3

Thanks so much! It works now. :grinning: