#12 Need Help


#1


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


When I press save and submit it says "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." when the console says "You're getting plenty of sleep! Maybe even too much!". Please help!


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


#2

@frog2dey,

  • -02. Inside the function,
    write an if statement where
    if the number of hours of sleep is greater than or equal to 8,

#3

Thanks, I didn't see the little mess up i did.


#4

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