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 trialBularca Andrei
2,408 Pointsmy 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 ?
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");}
<!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
33,990 PointsHi 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
23,309 PointsHey,
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.
- You spelled greater with grater in both the if and else alerts. Change that.
- 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!
Bularca Andrei
2,408 PointsThank 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
33,990 Pointsno problem Bulcara glad to help!!