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 trialPhuc Le
5,182 PointsIt looks like Task 1 is no longer passing.
I don't know what this error means?
The task just asked print to console the last item of array.
var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick'];
console.log(players[5]);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
1 Answer
andren
28,558 PointsIt means exactly what it says, this challenge is divided into two tasks, the first asks you to print out the first item of the array and the second asks you to print out the last. When doing challenges you need to keep the code of all the tasks around, you are usually not meant to remove or change code from the previous task.
Since you no longer have the code to print the first item of the array your code no longer passes task 1. If you add that code back like this:
var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick'];
console.log(players[0]);
console.log(players[5]);
Then you will be able to pass the challenge.
Phuc Le
5,182 PointsPhuc Le
5,182 PointsIt worked :D. Thank you.