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

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

this is exactly what he's asked to write.

the instructor said that you must have the document.write command to give the message that you are correct?

var answer= prompt("what is the best programming language?");
   if (answer==="Javascript" {
       "You are correct"); }
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="app.js"></script>

3 Answers

thank you otec.

Adam Beer
Adam Beer
11,314 Points

No! You forget the closing bracket of if() statement. And you forget the alert() dialog. Until your problem isn't resolve, please use one topic/question.

it is adam. the first line works fine. then it asks to do a conditional statement saying it's JavaScript. You are correct. I'm following his exact example. but it's not working

Adam Beer
Adam Beer
11,314 Points

Okey, but where are your alert() dialog?

Otec Perez Glass
Otec Perez Glass
7,678 Points

There you go include the the string inside the the conditional like this

alert( "You are correct" );  // hopefully that will help you.