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

Michelle T.
Michelle T.
4,242 Points

Why isn't my code working?

Conditional Statement:

if (a > b) { alert('a is greater than b.'); } else { alert('a is NOT greater than b.'); }

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Michelle! First, you're doing great! But you may have noticed by now that challenges can be extremely picky. In this case, it's looking for a specific string, but your string doesn't exactly match. You've included periods/full stops in your strings.

//Your code

else { alert('a is NOT greater than b.');

//Accepted code

else { alert('a is NOT greater than b');

Note the removal of the period/full stop after the b and before the ending quotation mark.

Hope this helps! :sparkles:

Michelle T.
Michelle T.
4,242 Points

Thank you!! I fixed it and it worked. Appreciate the help, Jennifer! :)