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 Tracking Multiple Items with Arrays Using Array Indices

Keith Nash
Keith Nash
9,156 Points

Clarity needed on Challenge 2 of 2 Using Array Indices. The question is wrong

Hello,

The question for Challenge 2 of 2 on Using Array Indices needs to be clarified. The question states "Now, use console.log() to log out the last item in the array." However, to complete the task properly, you need to console.log BOTH the first AND last items in the array.

If you only " use console.log() to log out the last item in the array," you will get a failure. A simple addition to this question mentioning that the first item in the array was also needed would go a long way towards alleviating confusion. It took me 10 minutes to figure out that the question was wrong, not my answer.

Matthew Long
Matthew Long
28,407 Points

Sorry for your confusion. For a challenge to be passed in full all parts of a challenge must passed. Therefore, you can usually assume that what you do in one part won't be undone in another part. Happy coding!

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! This message is included in the part where you would normally see a success or Bummer message before pressing check work. From what I know, this is true of all challenges here:

Important: In each task of this code challenge, the code you write should be added to the code from the previous task.

This means that you (unless explicitly directed to) are not to remove the code you previously wrote. These tasks are cumulative in nature.

Happy coding! :sparkles: