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

Gabriel Kieruzel
PLUS
Gabriel Kieruzel
Courses Plus Student 19,655 Points

Hello, When adding else statement and checking I'm receiving: Oops! It looks like Task 1 is no longer passing.

I went through 2 of tasks in this challenge. At task 3 adding else statement (quite easy) I'm receiving following message:

Oops! It looks like Task 1 is no longer passing.

No idea how as task 1 was cempleted.

app.js
var answer = prompt('what is the best programming language?');
if (answer === "JavaScript") {
 document.alert('You are correct'); 
} else {
  document.alert('JavaScript is the best language!'); 

}
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

Hi,

Have you tried: change your 2 alerts to only : alert("Text");

Gabriel Kieruzel
PLUS
Gabriel Kieruzel
Courses Plus Student 19,655 Points

Hi,

sorry for bit late but I would like to thank you. This suggestion helped me to move forwards. Indeed using short version 'alert("text");' allows me to pass the step.

Many thanks