Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables The Variable Challenge Solution

Just playing around - Can this code be improved?

here is my workspace: http://w.trhou.se/gr1krucwsd

Just wondering what I can do to improve this code a bit. it works as expected I think. Feedback welcome. Thanks.

Ali Abbas
Ali Abbas
2,097 Points

Hey natekindom

Wow! It's great that you put a lot of thought into it. You've added conditional statements etc. I think the whole idea of the exercise was to help apply to your story everything that was taught so far. Nonetheless, great job. It seems you've exceeded what's taught in class, but one thing I would still suggest. Your story is quite long, and complex compared to what's expected. Maybe break it down using the [var += "string"] method, to make it more easy to read. Anyways, all the best with the rest of the course. Again, good work mate.