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
joannabrumfield
2,078 PointsJavaScript Basics - Conditional Challenge Task
For some reason when I check my work it tells me that my first perimeter is no longer passing.. Everything still runs (including my prompt) so I am not entirely sure what the problem is.. Any ideas?
var answer = prompt('What is the best programming language?');
if(answer.toLowerCase() === "javascript") { alert("you are correct"); }
4 Answers
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 PointsTry adding quotes around "javascript".
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 PointsOK the syntax is good. Can you link to the exact challenge you are trying to do?
joannabrumfield
2,078 PointsEverything is working fine, I get my prompt, enter JavaScript, it downcases it and I get the alert I set up, but I am getting an error and it wont let me go to the third challenge because "the first parameter no longer passing."
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 PointsI am thinking the challenge is broken, but am still looking to see if I am missing something.
joannabrumfield
2,078 PointsThank you! I have already finished the rest of the JavaScript Basics course.. This is the onlything holding me back from my badge ;) And it was driving me crazy because everything was still running and looked fine.
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 PointsHere is the working code for part 2. It literally needs to compare to "JavaScript".
if(answer === "JavaScript") {
alert("You are correct");
}
I guess it requires very careful reading of the question.
joannabrumfield
2,078 PointsOh goodness! So I don't even need to add the .toLowerCase(). Thank you!
joannabrumfield
2,078 Pointsjoannabrumfield
2,078 PointsI did and it still spit out the same error