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

Erik Robles
PLUS
Erik Robles
Courses Plus Student 10,635 Points

Oops! It looks like Task 1 is no longer passing. Arrays Challenge Task 2 of 2

I keep getting the "Oops! It looks like Task 1 is no longer passing." message. I am pretty sure I have the right answer. I am trying to select the last element in the arrat. Any help? Thanks.

script.js
var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick'];
console.log(players[5]);
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

1 Answer

Ryan S
Ryan S
27,276 Points

Hi Erik,

In each task, your code should be added to the code from the previous task. It looks like you replaced your console.log() statement from Task 1 with the new one in Task 2. That is the reason for the "Task 1 no longer passing" message, because the code isn't there.

Erik Robles
Erik Robles
Courses Plus Student 10,635 Points

Thank you. I thought it only wanted to access the last item so, yes, I just replaced the 0 with a 5. Thank you for your help.