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 Loops, Arrays and Objects Simplify Repetitive Tasks with Loops The Refactor Challenge

The workspace always has the solution inside

Please fix

2 Answers

The workspace includes a deliberately bad solution. The task is to improve the code employing the programming principle of DRY (Don't Repeath Yourself) using a loop to repeat 5 lines of code much more clean and efficiently.

I checked a clean workspace, and it does in fact contain the bad code. If you're seeing the actual solution, is it possible you worked on the problem earlier? Your previous workspace work is saved by default.

John Lovato
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
John Lovato
Front End Web Development Techdegree Graduate 14,111 Points

I think what he meant is that sometimes the ACTUAL solution is already in the workspaces. I've noticed it several times myself in other workspaces, despite not working on them before. It appears to be different for everyone though, as for this challenge, the code is the original, non-DRY start.