Stuck on function last page revive question


whatever numHours I give it an error message considering give number as 10.But answer is displaying correctly right side of page

// 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!";
 return "Get some more shut eye!";


the string returned should be an exact match, copy paste it from the instructions


Take a look at the first character in the if code block return. It should be a capital.

The program is checking that the string in the console matches what they gave as a message. Therefore, it has to match exactly.

Tip: For these, copy and paste the code and string that they give in the instructions. It helps to avoid case and string construction problems.



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