JavaScript JavaScript Basics Making Decisions with Conditional Statements Introducing Conditional Statements

Sean Ratner
Sean Ratner
1,617 Points

add conditional statement

Im currently trying to pass this test and it's appearing that no matter what i add to the test it just tells me "Oops it looks like task 1 is no longer passing" (Refering to just the var)

app.js
var answer = prompt('What is the best programming language?');
if (answer === 'Javascript') {
  alert('You are correct');
} else {
  alert('You are incorrect');
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>

1 Answer

Paul Scanlon
PRO
Paul Scanlon
Pro Student 19,223 Points

Hey

So close!

You didn't close off your else statement

Happy coding

Paul

Sean Ratner
Sean Ratner
1,617 Points

Thank you! I skipped to the next section which also requires a conditional statement and realized this, though it was giving me a different. This problem specifically stating task 1 no longer completed is what was throwing me off, and making me think it was a different issue.