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 trialCaj Andersson
2,987 PointsWhy doesn't my if statement work?
Can't figure out why my if statement doesn't work in this code challenge :(
Can anyone help?
var answer = prompt('What is the best programming language?')
if (answer === 'Javascript') {
alert('You area 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>
1 Answer
Colin Marshall
32,861 PointsMake sure that strings in your answer are exactly how they are stated in the question. Capitalization matters. For example, Treehouse is not the same as treehouse.
Colin Marshall
32,861 PointsColin Marshall
32,861 PointsAs a further hint, there are actually two things you need to change in your answer. One on line 2, and one on line 3.
Caj Andersson
2,987 PointsCaj Andersson
2,987 PointsI found the issue with Java(S)cript. Thank you! Also corrected the spelling mistake on line 5 and it works great!