12. Syntax Error: Illegal Return Statement


#1

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

My problem is that I'm using return illegally, but as far as I can tell, I'm not.


#2

@tehluigi,

Have a close look at

Function


#3

Thank you, that fixed it.

it feels rather obvious now


#4

I'm not kidding, this works

// Write your function below.
// Don't forget to call your function!

var sleepCheck = function(numHours) {
return console.log(fat)
};