JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements Introducing Conditional Statements

Jena Powell
Jena Powell
1,133 Points

Uncaught 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
Jena Powell
1,133 Points

Nevermind. I see that I capitalized "If". I got it to work now :)