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 Conditional Statements - Simple code is not working... Any advice appreciated.

Hi all I am doing the Conditional Statements introduction and my code works - i.e. the prompt box appears and then an alert pops up "saying you are correct". However it says that my answer to Task 1 is no longer passing (first line of code) and wont let me continue. Could anyone shed some light on this?

var answer = prompt("What is the best programming language?");

if (answer.toUpperCase() === "JAVASCRIPT") { alert("You are correct") }

2 Answers

Maybe you need a semicolon after alert("You are correct")

Hi Brendan, thanks for that but it still didnt work. The code to me looks fine and it is functioning but something is going wrong with the test first line of code....