Not working


#1


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


I think i wrote the code in the right way but for some reason this pops up

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.


var 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);


#2

Problem1.
return"get some more shut eye!"}};
update**
put space between return and string you're returning.

further update**
I know you're still getting the error? :slight_smile:

You did one small mistake....

Problem2.
instead returning string..
return "You're getting plenty of sleep! Maybe even too much!";

Y of You is Capitalized.
and instead of to it is too

You returned...
return "you're getting plenty of sleep! Maybe even to much!";

also in else part--

Problem3.
You have did one misspelling mistake:
You wrote get instead of Get

Problem4.
Indentation problem...

Indent it properly..
sleepCheck(10);

I hope it solves the problem! :slight_smile:
do tell if solved the problem!


#3

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