Functions and if / else


#1

HELP WITH FUNCTIONS AND IF/ELSE EXERCISE

LINK TO EXERCISE I AM STUCK AT:
https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/2/4?curriculum_id=502d635ceda910000200293b

KEEP GETTING THIS ERROR:
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.

// Write your function below. 
// Don't forget to call your function!

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

#2

I just made the 'y' on 'You're getting plenty of sleep' a capital and it worked.


#3

Be sure your code uses the exact text given in the error message (and the instructions).


#4

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