javaScript chapter 1 lesson 12


#1

I don't know what the heck is wrong with this code ! Can anyone help?

// 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! May be even too much!");
}
else{
return ("Get some more shut eye!");
}
};

sleepCheck(10);
sleepCheck(5);
sleepCheck(8);

#2

Two things:

  1. JavaScript return statements may be written inside parentheses, but shouldn't be. The strings are already delimited by quotes.

  2. Follow the instructions to the letter and use the exact phrases provided.


#4

I got it. Thanks dude :wink:!


#5

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