Introduction to Functions in JS


#1

// 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);
sleepCheck(5);
sleepCheck(8);

Having the following 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.


#2

HI try to refresh the page..