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 trialBrett Kalwarski
Courses Plus Student 1,733 PointsI am answering the question right but it is saying I am wrong I just want to go forward on now.
It almost looks exactly like the code from the video but different for the question
var answer = prompt('What is the best programming language?');
<!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>
2 Answers
Scott French
7,383 PointsNot sure what your doing wrong but these passed for me perhaps case sensitive your answer says (answer == 'Javascript') and you should use a strict equality.
var answer = prompt('What is the best programming language?');
if (answer === 'JavaScript'){
alert("You are correct");
}else {
alert("JavaScript is the best language!");
}
Steven Parker
231,275 PointsYour app.js code looks great.
You should pass task 1 and be able to go on to task 2. If you're not passing task 1, try cutting your answer from above and pasting it directly into the challenge. I did exactly that myself and it passed.
Brett Kalwarski
Courses Plus Student 1,733 PointsBrett Kalwarski
Courses Plus Student 1,733 PointsIt's actually the second part that is not passing every time i put in the right answer
var answer = prompt('What is the best programming language?'); if (answer == 'Javascript') { alert('You are correct'); }
or
var answer = prompt('What is the best programming language?'); if (answer.toUpperCase === 'JAVASCRIPT') { alert('You are correct'); }