Please help with 12/13


#1

What am I doing wrong? Help please. This is totally confusing to me.

// 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!";
}
{
console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));
};


#2
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!");
}
};

console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));

This is my code. I believe the difference between yours and mine is that you put your console.log's on the inside of the function, but mine is on the outside. So, I believe that the reason it isn't working is because you put the console.logs inside. Therefore, this problem may be fixed when you move them to the outside of the function.

Hope it helped! :smile:


#3

Thank you SO SO much. I am not very good at this and have spend an hour trying to fix it. I really appreciate your help. Thanks!