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

my code runs fine and it does what is supposed to do , i think this is a bug , i have a bummer

Why does is not pass ?

script.js
var a = 10;
var b = 20;
var c = 30;
if(a > b )
{alert( "a is grater than b");}
else{
  alert("a is NOT grater than b");}
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>

3 Answers

Grace Kelly
Grace Kelly
33,990 Points

Hi Bularca, your code is perfect, however you have some minor spelling mistakes in your strings, which the challenges can be picky about. You have spelled "greater" incorrectly and I think the challenge would rather a lowercase "not" rather than "NOT", if you make these small changes the challenge should pass:

if(a > b )
{alert( "a is greater than b");} //fix spelling
else{
  alert("a is not greater than b");} //fix spelling

Hope that helps!!

Ryan Ruscett
Ryan Ruscett
23,309 Points

Hey,

No worries, you have it right, technically, but you made some spelling mistakes which is tripping the test to make sure you got it right.

  1. You spelled greater with grater in both the if and else alerts. Change that.
  2. You do not capitalize NOT. Leave it lower case since the tests are very sensitive.

Do that and your code will work. Please let me know if it doesn't or if you have any other questions. I would be happy to help.

Thanks!

Thank you , foolish of me not to check the grammar , the bummer told me "I don't see a is NOT greater than b"

Grace Kelly
Grace Kelly
33,990 Points

no problem Bulcara glad to help!!