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) 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.

1 Answer

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.