JavaScript JavaScript Basics Making Decisions with Conditional Statements Introducing Conditional Statements

Sean Ratner
Sean Ratner
10,405 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)

var answer = prompt('What is the best programming language?');
if (answer === 'Javascript') {
  alert('You are correct');
} else {
  alert('You are incorrect');
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="app.js"></script>

1 Answer

Paul Scanlon
Paul Scanlon
Pro Student 24,007 Points


So close!

You didn't close off your else statement

Happy coding


Sean Ratner
Sean Ratner
10,405 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.