Sleep Check ()


#1


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


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 too much!";
    }
    else{
        return "Get some more shut eye!";
    }
}
console.log(sleepCheck(10))
console.log(sleepCheck(5))
console.log(sleepCheck(8))


#2

Check your text strings. There may be a few too many spaces.


#3

you forgot ";" between console.log command

try

console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));


#4

Actually you missed 'even' word causing error

you wrote Maybe too much! instead of Maybe even too much!


#5

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