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

Cipriano Mauricio
Cipriano Mauricio
3,560 Points

Oops your answer to Task 1 is no longer valid???????

I'm getting this message. I tried to get through this task a million times. It keeps giving me this message even though I have not touched the line from task 1. Is this a bug??

Oops! It looks like Task 1 is no longer passing. Get Help Recheck work Go to task One app.js index.html

var answer = prompt('What is the best porgramming language?'); if (answer.toUpperCase() === 'Javascript') { alert('You are correct')

}

app.js
var answer = prompt('What is the best porgramming language?');
if (answer.toUpperCase() === '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>

1 Answer

Grace Kelly
Grace Kelly
33,990 Points

What you are asking in your conditional statement is if the answer converted to uppercase is equal to 'JavaScript' which means this will always equate to false no matter what the answer is. Even if the user inputs "JavaScript" this is then converted to "JAVASCRIPT" which will not match. So if you remove the .toUpperCase() method from answer, it should work :)