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 trialJena Powell
1,135 PointsUncaught SyntaxError: Unexpected token {
When I test the code, the prompt does not appear. I went into the console, and I see the error "Uncaught SyntaxError: Unexpected token {". I've double checked my work, and I don't see anything different than what is displayed in the video. Could someone please take a look at this with me.
Here is the code I saved to my workspace below:
var answer = prompt("what programming language is the name of a gem?"); If ( answer === 'Ruby') { document.write("<p>That's right!</p>"); }
1 Answer
Jena Powell
1,135 PointsNevermind. I see that I capitalized "If". I got it to work now :)