Lesson 12 Syntax error Unexpected EOF?


I cannot find what is wrong with this code but it will not run.

var sleepCheck = function(numHours){
if(sleep>= 8){

return "You're getting plenty of sleep! Maybe even too much!;


return "Get some more shut eye!";


2 points:

  1. at your IF statement, change "sleep" to "numHours"
    OR change "numHours" in function() to "sleep"
    either way is okay.
    What parameter you have in function declaration should match the one in function definition.

  2. add closing " on "You're getting...".
    it is a string, make sure you open and close a string.


I have aslo a problem with this lesson!
this is what i am writing and am getting this respond
Oops, try again. It looks like sleepCheck() isn't returning "You're getting plenty of sleep! Maybe even too much!" when numHours is 10. Check your if / else syntax and whether you're using the correct comparison operator.
what am i missing?

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


You are missing a semicolon for your sleepCheck function


where exactly do you mean ?


after very last of your closing curly bracket.
http://inimino.org/~inimino/blog/javascript_semicolons. Check this link out, if want to know more about semicolons


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