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 trialRam Iyer
9,116 PointsI am getting this error where it is telling me use answer==='Javascript' when that is exactly what I have done
My code var answer = prompt("What is the best programming language?");
if ( answer ==='Javascript' ) { alert("You are correct");}
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
Andrew VanVlack
20,155 PointsTake a closer look at the capitalization you have and what they ask. When comparing 2 strings, the condition will be false if you do not have the same capitalization on both strings. In later course you will learn how to deal with this.
Ram Iyer
9,116 PointsAdd a conditional statement that opens an alert dialog box with the message "You are correct" when the answer contains the string 'JavaScript'
That is what they asked and what I have put in my code. Its Javascript with a capital J.
I am also getting the desired output.
Ram Iyer
9,116 PointsOh I am sorry, I see it now. Thanks a lot!