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 trialBrittany Smith
8,046 PointsTask 1 passes but when I try Task 2 it tells me Task 1 is no longer passing?
When I try to check my work on Task 2 it tells me my Task 1 is no longer passing, but I go back to Task 1 and it passes. Sending me in an endless loop.
var answer = prompt("What is the best programming language?");
if ( answer === "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>
3 Answers
doesitmatter
12,885 Pointsalert(You are Correct);
should be: alert("You are Correct");
Brittany Smith
8,046 Pointsmaybe it just wants double quotes instead of single quotes
doesitmatter
12,885 PointsNo this shouldn't matter at all, as long as you close the string with the same number of quotes as you started. If the problem persists you should ask the question again and tag a moderator
Brittany Smith
8,046 PointsI was using square brackets instead of curly brackets
doesitmatter
12,885 PointsWell thats no good.
Brittany Smith
8,046 PointsBrittany Smith
8,046 PointsEven if I correct that it still tells me that "Task 1 is no longer passing" sorry, I did correct that. I even tried erasing everything and retyping it in for task 2. idk what's going on.
doesitmatter
12,885 Pointsdoesitmatter
12,885 Pointshmm thats weird, I tried your exact code, with the quotes in it of course and it passed without error...