Function and if/else


#1

I write the code but still have error couldn't figure out
here is my code

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


#2

Capitalize the y in you're and you should be ok. Remember to use the exact text strings given in the instructions :slight_smile:


#3

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