sleepCheck function - Cannot able to clear this. Dont know where i am missing. Can anyone help me out


#1


// Write your function below.
// Don't forget to call your function!
var sleepCheck = function (numHours)
{
if(numHours >= 8)
{
return "You are getting plenty of sleep! May be even too much";
}
else
{
return "Get some more shut eye!";
}
};
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);

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.


Replace this line with your code.


#2

Don't worry, it's an common mistake. Just a simple typo. Your code outputs You are getting plenty of sleep! May be even too much but you need to output You're getting plenty of sleep! Maybe even too much!
When you print/log or return something on these courses, you need to make sure that you output the exact thing that the course is saying. It's probably easier to just copy and paste the message, if you need to.


#3

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