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 trialLewis Morgans
3,167 Pointsconsole.log(players[5]); is actually correct? but says it's not...
Says to console log the last item in the array, which is at position 5.
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>
3 Answers
Steven Parker
231,275 PointsPerhaps you overlooked the caution displayed by the challenge: "Important: In each task of this code challenge, the code you write should be added to the code from the previous task."
The code shown here is correct for task 2, but the task 1 code seems to be missing.
Tsenko Aleksiev
3,819 PointsYou only write 5 instead of 0 to win this challenge, but you have to have both of them ( one per line ) otherwise, yes console.log(players[5]); is true :)
John Lott
5,459 PointsI'm having the same issue.
var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
months.join(', ');
console.log(months[11]);
Steven Parker
231,275 PointsThis is clearly from a different challenge. Try starting a new question and be sure to show your code and provide a link to the course page.
In the meantime, one hint: the string for "join" should go on the left, and the list should be the argument.
John Lott
5,459 PointsHi Steven. I apologize as I am a little new to how this message board works. Thanks for advice. I will submit a new question.