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

General Discussion

Code challenges: what does it mean to add to previous code?

I always see something like this in code challenges, but I am not sure I understand what it means. "Important: The code you write in each task should be added to the code written in the previous task."

What are we meant to be doing with the code challenges? What does this sentence mean?

1 Answer

Hi Allison,

This is relevant to code challenge that have more than 1 task.

In task 1 you'll be asked to write some code. Then in task 2 you'll be asked to write some more code. You should not remove the code that you wrote for task 1. Only add in the new code for task 2.

Does that make sense?

It does. But it also appears on the first task, before I've written anything. So it seems like it's not directly relevant to what I'm doing.

I thought I'd ask about it, in case there was something I wasn't doing that everyone else understood.

Yes, I think treehouse has it appear by default on every task number even though it's not technically relevant on the very first task since there is no previous task when you're on the first one. Maybe it's just to give you an early warning not to delete the code you're about to write when you get on to the next task.