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 trial3 Answers
Mark Cranny
3,019 Pointsvar answer = prompt('What is the best programming language?'); if (answer.toUpperCase === 'Javascript') { alert('You are correct'); }
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsThe problem is toUpperCase. If someone puts in "JavaScript", and then you call toUpperCase on their input, it will be JAVASCRIPT.
Aaron HARPT
19,845 PointsHere is the correct code: var answer = prompt('What is the best programming language?'); if (answer === 'JavaScript') { alert('You are correct'); }
Mark Cranny
3,019 PointsApologies, 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.
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsBrendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsI just passed it, it's not broken. Post your code and we'll figure out the problem.