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 trialMichael Gardiner
4,282 PointsDon't see the problem
Where did I trip up?
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>
Laura Kyle
19,794 PointsIf it makes you feel any better, these types of mistakes are guaranteed to plague your entire career as a developer. You just get better at debugging them, but they will forever remain frustrating. ...That probably didn't help at all.
Keep up the great work!
2 Answers
Rich Donnellan
Treehouse Moderator 27,708 PointsMichael,
Java*S*cript is case sensitive. This can lead to problems in your code.
Hint: see bold letter ^
Hope this helps!
βRich
Michael Gardiner
4,282 Pointssigh, something so simple as that haha yeah that worked thanks!
Rich Donnellan
Treehouse Moderator 27,708 PointsIt usually is! Keep at it!
Henrique Zafniksi
8,560 PointsThe code is correct. If you are seeing errors, probably you are answering "Javascript" differently in the prompt, such as "javascript", or "JAVASCRIPT", or "javaScripT".
JavaScript is a code sensitive language, which means "JavaScript" === "javascript" will evaluate false.
To make sure you got it all right, you can try the .toUpperCase() method. This method will compare the uppercase version of the two strings.
if(answer.toUpperCase() === "JavaScript".toUpperCase()) {
alert("You are correct");
}
Laura Kyle
19,794 PointsLaura Kyle
19,794 PointsHey there! I'm pretty sure it's just that the "S" in JavaScript needs to be capitalized. Give that a shot.