If/else syntax error


i think i did this right but it keeps saying
Oops, try again. It looks like your function doesn't return "Get some more shut eye!" when numHours is 5. Check your if / else syntax and whether you're using the correct comparison operator.

i don't know whats wrong please check my code

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


it looks like you didn't close one of your braces where it says
"var sleepCheck = function (numHours) {" do you see what I mean?


thank you so much i have been stuck on this :smile:


wait it still dosnt work :hushed:


thats odd I thought that would fix it


what error does it say that you have?


it says the same thing and i actually DID close the curly brace


are you sure you need the curly braces?


yes i take them away it says i have a syntax error


i'm sorry to say I'm not sure whats wrong


its ok :wink: thanks for trying


you need to pass the different hours in like so

else {
return "get some more shut eye!";
} }


From the error message I'd say that you need to write the else phrase with a starting capital "G". Anyway the syntax seems to be ok so just check your sentences closely on typos or just copy and paste the messages from the instruction. Good Luck!