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 Using Comparison Operators

what is the answer for this. i have been stuck on it for hours but cant come up with a suitable answer

Can someone please help me out

script.js
var a = 10;
var b = 20;
var c = 30;
var answer =
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>
Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

Can you share what code you have tried?

This will help others to better help you figure out where your errors are occurring and/or what you might be struggling with. Just providing answers doesn't promote a strong learning environment.

Some hints: Here you will need an if and else if conditional. I would suggest maybe a quick review of the first two videos (they both cover exactly what is needed for this challenge). Then give is another go, and if you're still stuck, post the code you are trying and we'll be able to assist you in troubleshooting your code.

:) :dizzy:

Vladimir Kalugin
Vladimir Kalugin
5,116 Points

if(a > b) alert('a is greater than b'); else alert('a is not greater than b');