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


Please can someone tell me what is wrong with code? It is returning correct values in results screen and also it works fine when I run on Google Chrome console.

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



Seems like your missing an exclamation point at the end of your sentence. Anyway your syntax seems to be ok the problem is probably a typo in your messages. If you can't find them copy and paste the messages from the instructions that is not the important part of the exercise. Although being careful about typos is important in programming.


Thank you. When I read your reply, I thought you must be joking but you are absolutely right. I've added the "!" mark and solved it. It is frustrating but I'm here for a purpose and better follow the rules of the game.

Thank you again!


Thanks guys. Had the same problem, but with the "Get some more shut eye!" part. Be wary and do everything the lesson tells you to do!


My syntax matches, braces are where they should be, semicolons added. What is going on here???


No, idea and it is impossible to find out if you don't post your code. But please do it in an own thread and don't revive a dead thread if you have nothing on topic. Thanks.


I figured this issue out. The error is being triggered when 2 spaces are entered between the, "!" and "Maybe" of the first return statement. Check to see if you entered 2 spaces, if so, delete one and you should be good to go!

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



Thank you..nearly i spend 4 hours to execute this code..finally your answer help me a lot..i learn the importance of Typo in the program