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

Is this step broken?

This stage appears broken

I just passed it, it's not broken. Post your code and we'll figure out the problem.

3 Answers

var answer = prompt('What is the best programming language?'); if (answer.toUpperCase === 'Javascript') { alert('You are correct'); }

The problem is toUpperCase. If someone puts in "JavaScript", and then you call toUpperCase on their input, it will be JAVASCRIPT.

Here is the correct code: var answer = prompt('What is the best programming language?'); if (answer === 'JavaScript') { alert('You are correct'); }

Apologies, I posted the wrong code - I did have 'Javascript' in uppercase like 'JAVASCRIPT'.

I had already attempted your suggestion but it was also throwing an error - however today it appears fixed.

Thanks for the quick response.