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 trialDwayne Sauls
1,279 PointsI am having trouble understanding what this question wants me to-do.
It looks like task 1 is no longer working.
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>
4 Answers
Dwayne Sauls
1,279 Points@Joel Bardsley It still says no longer passing
Dwayne Sauls
1,279 PointsWhen I made the change
Mayur Pande
Courses Plus Student 11,711 PointsYou are not storing the prompt in the answer variable. Also remember what Joel Bardsley has said about checking if the answer is equal to a string.
Dwayne Sauls
1,279 PointsI did the following: var answer prompt('What is the best programming language?') if(answer === JavaScript){ alert('You are correct'); }
Dwayne Sauls
1,279 Pointsvar answer prompt('What is the best programming language?') if(answer === 'JavaScript'){ document.write('You are correct'); }
Solved it! Thanks! Mayur Pande
Mayur Pande
Courses Plus Student 11,711 Pointsno problem, but from looking at your code it still seems wrong! Have you used the equals sign like so?
var answer = prompt('What is the best programming language?')
if(answer === 'JavaScript')
{
document.write('You are correct');
}
Dwayne Sauls
1,279 Pointsohja I forgot about the variable equals sorry ill fix it right away. Really appreciate it Mayur Pande .
Joel Bardsley
31,249 PointsJoel Bardsley
31,249 PointsRemember to use strings for the answer and the alert. Syntax errors in your code are causing the 'task 1 is no longer working' message to appear.