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 (Retired) Making Decisions with Conditional Statements Introducing Conditional Statements

Saira Bottemuller
PLUS
Saira Bottemuller
Courses Plus Student 1,749 Points

Weird errors in this Challenge/program. Talked to Help@teamtreehouse already. HELP!?

Hi everyone! I've finished the entire JavaScript Basics course EXCEPT for this one stinkin' challenge. Here is the address of the Challenge:

http://teamtreehouse.com/library/javascript-basics-2/making-decisions-with-conditional-statements/introducing-conditional-statements-2

I have actually written to tech support about it once already, but the problem continues. When I've had other issues, I've found it was my own error that caused the problem. In this instance, I don't see how it could be - I have run this bit of code through JSHint, and even within the Challenge screen, it operates as it should. I'm not sure why I keep getting these weirdo errors, but this Challenge is the one thing standing between me and TOTAL WORLD DOMINATION------er....TOTAL JAVASCRIPT BASICS DOMINATION!!!!!!!!!!!!!!!!! mwahahahahaha :D

I have screenshots of the errors (though it won't let me post them here), as well as the JS alert that pops up just as it should, as well as of JSHint not finding any errors in my code. Error message is usually "Oops! It looks like Task 1 is no longer passing."

So...any ideas?

var answer = prompt('What is the best programming language?');

if (answer.toLowerCase === "javascript") {

    alert("You are correct");

}
app.js
var answer = prompt('What is the best programming language?');

if (answer.toLowerCase === "javascript") {

    alert("You are correct");

}
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>

3 Answers

Hi Saira,

Here's minor problems you will find there:

1) You write - 'javascript'

-This question challenge require specifically in title - 'JavaScript'

2) it didn't ask you to add extra code to lower case of letters - ".toLowerCase"

;)

Hi Saira,

Here is the solution to this challenge:

var answer = prompt('What is the best programming language?');

if (answer === 'JavaScript') {
  alert('You are correct');
}  else { 
        alert (" JavaScript is the best language!");
        } 

Just a couple of lower and capital letters that need to match. Then it will ask you to create an else statement

Hope that helps.

Saira Bottemuller
PLUS
Saira Bottemuller
Courses Plus Student 1,749 Points

Oh wow, I had no idea it was going to ding me on the .toLowerCase thing, it's something I'd learned in a prior course, regarding manipulating the user's input so that it doesn't reject on something silly like they typed "RUby" instead of "Ruby". That's nutty, thank you so much for your help, Salman and Victor!!!! :)