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!
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
Michael Zeta18,135 Points
Step two says Task 1 no longer passing even though it is identical to when it passed in step one.
Am I missing something or is this code challenge broken? Task 1 asks me to create a variable named 'answer' and to use the prompt() method to ask the user what is the best programming language. So I typed:
var answer; prompt('What is the best programming language?')
and this passes for step one. Then in step two I leave this code completely untouched but no matter what I do it always says that task one is no longer passing. Why? Please help.
Thomas Fildes16,201 Points
You need to check the answer variable in your if statement not the prompt. Prompt is just a method that asks for user input which we assign to a variable (answer). Here is the code I used to pass this part of the challenge:
Hope this helps! Happy Coding!!!