#12. Try again when code runs ok


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=506324b3a7dffd00020bf661


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.

Thanks


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


#2

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"


#3

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.


#4

Oooohhh!!! Sorry!!!

Finally!!!

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

Thanks again


#5

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.


#6

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