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

3 Answers

Mark Cranny
Mark Cranny
3,019 Points

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

Aaron HARPT
Aaron HARPT
19,845 Points

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

Mark Cranny
Mark Cranny
3,019 Points

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.