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 Booleans

brain farted :(

I just forgot everything..

script.js
if (true) {
    alert('This is true');
} else {
    alert('This is false');
}
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="script.js"></script>
</body>
</html>

add a boolean value to the condition in this conditional statement. Use a boolean value that will result in the message "This is true" appearing in an alert box.

Chris Shaw
Chris Shaw
26,676 Points

Hi Timothy,

What is your actual question as the code you have works perfectly fine for this challenge?

it just will not work for my code challenge for some reason do you know what the problem could be ?

Chris Shaw
Chris Shaw
26,676 Points

Try again, if it continues to fail try it in another browser. From my end the challenge is working as expected.

good deal i'll give it a shot thanks for the assist.

Hey Timothy McKyer,

I don't know if you have adblock or similar extension enabled in your browser, but I used to have problems until I disabled it for this site. As Chris said, your code is perfect, so that was something I was thinking.

2 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Well??? Timothy McKyer , what's wrong about your JavaScript code? I don't see anything wrong, it's totally fine.

really ????

did you see the question too?

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Looks fine to me too. :)

For retention of what has been learned i always watch each video twice unless i'm absolutely sure I understand the material.

Also use a program like Evernote to write notes for the videos and code snippets. It's an invaluable learning tool in my opinion. :-)