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 trial

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements Introducing Conditional Statements

is saying that task one is no longer good

is my mistake in task one or in the task 2

app.js
var answer = prompt("what is the best programing language");
if ( answer === JavaScript ) {
  aler('You are correct')
}
index.html
<!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

Dave Harker
PLUS
Dave Harker
Courses Plus Student 15,510 Points

Hi Niels,

Looks like you've spelt 'alert' incorrectly. Also, from what I can see in the code at least, you've not covered the requirements for task 2. See below:

var answer = prompt("What is the best programming language?");

if (answer === "JavaScript") {
  alert("You are correct");
} else {
  alert("JavaScript is the best language");
}

You're doing great, keep going!

Dave.

Antonio De Rose
Antonio De Rose
20,884 Points
var answer = prompt("what is the best programing language");
if ( answer === JavaScript ) { // please check, if this how you compare a string, shouldn't it be in quotes
  aler('You are correct') // check spelling on alert
}