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 triallaksh khamesra
4,475 PointsObjective won't go to next question even though answer is correct?
Please see this screenshot. This is regarding: Javascript basics -> Making Decisions with Conditional Statements -> Introducing Conditional Statements
Even after I enter the correct answer in the prompt box, the test wouldn't pass it.
4 Answers
Samuel Key
3,310 PointsWhat you enter into the prompt box comes back as a string, so you need quotes around JavaScript on line two. Also you don't need the paragraph tag in an alert box.
Try this:
var answer = prompt('What is the best programming language?');
if (answer === 'JavaScript') {
alert('You are correct!');
}
Micah Fay
11,780 PointsFor some reason this challenge doesn't seem to accept .toLowerCase() or .toUpperCase() answers even if written correctly. I get the same looks like Task 1 is no longer passing. However if you just remove the method and capitalize the "JavaScript" string in your conditional it should run fine.
I also overlooked the capital S in JavaScript initially...
Jeff Chabot
5,727 PointsLearntree can you please clarify this question? The step after adding the variable does not specify using toUpperCase or toLowerCase.
And, I've tried several questions and cannot get past this step. I keep getting the error
Oops! It looks like Task 1 is no longer passing.
debbymel
5,017 PointstoLowerCase and toUpperCase Didn't work for me either. My solution was using || if(answer=== 'ruby' || answer === 'Ruby' || answer ==='RUBY')
Samuel Key
3,310 PointsSamuel Key
3,310 PointsYou can also add
so that capitalization doesn't matter.