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 - 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

Try adding quotes around "javascript".

I did and it still spit out the same error

OK the syntax is good. Can you link to the exact challenge you are trying to do?

Everything 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."

I am thinking the challenge is broken, but am still looking to see if I am missing something.

Thank 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.

Here 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.

Oh goodness! So I don't even need to add the .toLowerCase(). Thank you!