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

Dustin Dignadice
Dustin Dignadice
9,076 Points

Oops! It looks like Task 1 is no longer passing. error message keeps on appearing even though the answer is right.

In one of my conditional statement quiz. I keep on getting this error, "Oops! It looks like Task 1 is no longer passing" even though my code is giving the expected result. Is this some kind of bug or am I doing something wrong?

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

Michael Hulet
Michael Hulet
47,912 Points

Your problem is probably that you're declaring and assigning the answer variable twice. Just delete one of those lines, and it'll probably be good. Try this:

//You only need one of these lines
var answer = prompt('What is the best programming language?');

if(answer.toUpperCase() === 'JAVASCRIPT'){
  alert("You are correct");
}
Dustin Dignadice
Dustin Dignadice
9,076 Points

I removed it already but still the alert message is showing up. Maybe i'll just skip this exercise for now. Thanks for the response.