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 Add a Final Else Clause

I really do not get i must of tried a lot of time and still nothing

help

can you show us your code? Else statements are generally the last "catch all"option so if everything previous does not pass, do this. Format is usually Else{ the code you want to execute}

ty

1 Answer

Douglas Counts
Douglas Counts
10,126 Points

I assume that you are trying to add the final else clause. If so, then check your brackets to make sure you are adding the else to the proper if statement because if statements can be nested. Also a semi-colon will end an if statement, so make sure you are not placing your else just after a semi-colon.