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 trialKevin Doherty
Courses Plus Student 2,601 PointsOops! It looks like Task 1 is no longer passing.
I keep getting: "Oops! It looks like Task 1 is no longer passing." but my code seems correct
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>
john larson
16,594 PointsThe script.js file contains an array of string values -- the names of players in a game. Let's practice using array indices to access individual names in the array. Log the first name of the array using the console.log() method.
3 Answers
Josh Salyer
7,265 PointsWith most of these challenges with multiple steps, they want you to ADD code to what you already have (most of the time). So in your case, simply log the last element in the array to the console on a new line after logging the first element:
var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick'];
console.log(players[0]);
console.log(players[5]);
john larson
16,594 PointsHi, your not logging the first player. I only looked at the first question. If the second question asks for something else you usually need to leave the first answer there
john larson
16,594 PointsThis is what it needs to look like to pass
var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick'];
console.log(players[0])
console.log(players[5])
Kevin Doherty
Courses Plus Student 2,601 PointsAh apologies, makes sense :) i updated 0 to 5 instead of adding another console.log like you have shown thank you!
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsWhat's the task's question?