Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Eric Bezanson
2,907 PointsJavaScript help! syntax error: unexpected token {
var sleepCheck = Function(numHours) { if (numHours <= 8) { return "You're getting plenty of sleep! Maybe even to much!"; } else { return "Get some more shut eye!"; } };
Im assuming that means that there is a misplaced "{" somewhere but from my understanding the function needs to me incased in {} as well as the code inside both if and else sections.
I know its prob something small but I cant figure it out! please help!
1 Answer
jamescool
44,592 PointsThe answer has to do with the proper capitalization of a JavaScript keyword. Try a few things...if you need additional help, let me know. :)
Eric Bezanson
2,907 Pointsahhh! captial F! man i just said another work out loud that starts with a capital F!! thank you!
Eric Bezanson
2,907 PointsEric Bezanson
2,907 Pointssorry it ruined the layout of my code when i submitted the topic, so it is hard to read.