Functions and if/else


What's wrong with this???

var sleepCheck=function(numHours){
if (numHours>=8){
return "You're getting plently of sleep!Maybe even too much!";
else {
return "Get some more shut eye!";


Add a space between the "!" and "Maybe" in your first return statement. And make sure you spell "plenty" right.


remove var before defining function


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