#12. Try again when code runs ok



Hi, my code runs ok on the console, but every time I "save and submit" my code I find this note:

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.

I can't check my progress.


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


It says you're not returning X, so go look at the part responsible for returning X and compare. Nearly the same is still different so when you do that comparison you'll need to check that it's exactly right, not just "looks right"


Thanks ionatan.

I'm newbie and I didn't know codes can run "right" when it isn't "exactly right".

I will check the code again but I don't know what is exactly wrong.


Oooohhh!!! Sorry!!!


I found the error. I wrote "plently" instead "plenty"

Thanks again


Point is that it's common to glance at something and not see a difference and therefore assume there isn't one. It's very important to remember what our assumptions depend on to be true.


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