Where did I go wrong on this one?



Hey guys, I'm getting the correct answers displayed in the console. My console displays this when I submit the code :

"You're getting plenty of sleep ! Maybe even too much!
Get some more shut eye!
You're getting plenty of sleep ! Maybe even too much!"

Which seems to be the right answers for each value however when I submit and send the code I get this exact error message (not in the console, but at the bottom of the page) :

" 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. "

It seems really weird cause the console is actually displaying the correct answer so I see no issue there.

Here the code I made for this exercise

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




Any help on what I did wrong ? I can't really see the error on my syntax. I'm very new so if you could ELI5 that would be awesome !

Thanks for your time!


Ok nevermind, I found it. There was an unecessary space between sleep and the ! mark.

Sorry about the useless post, should've thought about this a bit more.


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