If/else function error message


Hello, someone take a look at this and tell me why I keep getting an error message? I saw an earlier question about the same exercise I was doing and I duplicated everything, but I'm still getting an error. Please help.

Replace this line with your code.


remove all the ; after }


Thank you for the suggestion, but I am still getting an error. So frustrating.


The program doesn't know what to apply the if/else statement to because you're forgetting to wrap your inner function in curly brackets:

var sleepCheck = function(numHours) {
	if(numHours >= 8) {
		return "You're getting plenty of sleep!";
	} else {
		return "Get some more shut eye!";



You're amazing, thank you!


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