Stuck on functions and if/else


Stuck on functions and if/else. What's wrong with this code?

Codecademy says it's not returning "You're getting plenty of sleep! Maybe even too much!" when numHours = 10
No error messages

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


HI try to refesh the page..



++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser


Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


Didn't work. Oh well, think I'll move on to the next exercise. Pretty sure the code is right. Thanks for the help, though.


Yeah, I did both. Although, didn't know the command for refreshing. You learn somethng new every day! :slight_smile: