Unexpect token in JavaScript 2 exercise 12


can anyone help me find my unexpected token


I apologize but what lesson is this @kimothekat?


Nevermind @kimothekat I found it, it was 12, the Community Manager changed it to "123" which confused me.


// Write your function below.
// Don't forget to call your function!
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!"; }

Now @kimothekat your issue seems to be when you forgot to put

var sleepCheck = function(numHours); {

Which resulted in a unexpected "}" token because it did not know what "}" was supposed to close
Also do not forget to put an extra "}" after you put the "{" after the function


Also I do not know if this was purposeful or not but @albionsrefuge if your edit was supposed to be a joke I highly believe that you should be marked down a rank for changing the exercise number from 12 to 123 because that really confused me in the response to @kimothekat. If it is accidental I apologize for what I have just said.


It was indeed accidental. I was moving the post to the category called:

3 Introduction to Functions in JS

and I typed a 3 in the wrong place.

Thank you for kindly pointing it out.


@albionsrefuge I believe that mistake should not be allowed to a person of such high ranking as you but again I do not make the rules of these forums.


And now I hope that you are joking. :green_heart:


Why do you hope I am joking @albionsrefuge?


This is not a place where mistakes are forbidden. Everyone makes mistakes. Mistakes are just learning opportunities.


I will not argue with you for I partly agree with what you are saying @albionsrefuge, the only part I do believe is that mistakes here are meant for people who code incorrectly and do not know what they did wrong, not for people of high trust levels in the forum that make a mistake in editing someone's post so that people may properly answer them and help them understand what they did wrong.


Many Thanks! code is working and I'm off to rock paper scissors


@kimothekat You are very welcome!