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 trialDustin Dignadice
9,076 PointsOops! 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?
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");
}
<!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
47,913 PointsYour 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
9,076 PointsDustin Dignadice
9,076 PointsI removed it already but still the alert message is showing up. Maybe i'll just skip this exercise for now. Thanks for the response.