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!
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
MUZ140191 Prudence Goreraza
9,480 Pointsjavascript loops,arrays and objects
The 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.
console.log(Jim[0]); my code keeps on saying bummer
6 Answers

Brooke Janssens
8,090 PointsAlmost had it, you need to replace "Jim" with "players."
console.log (players[0]);
The 0 is what is calling the first name of the array (Jim)

ellie adam
26,376 PointsJim is not a list. Players are Array.
console.log(players[0]);

A Laypanov
27,579 PointsI don't see your code, but I think "Jim" is the first string in the array "names". So to access it you should place index of the string after name of the array: names[0]

MUZ140845 Motion Kativhu
9,585 Pointsi've typed this but still giving me this massage "Bummer! Remember arrays are 'zero-indexed' meaning the first item in the array is at position 0." where am i going wrong var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick']; console.log (players[0]); console.log (players[1]); console.log (players[2]); console.log (players[3]); console.log (players[4]); console.log (players[5]);

MUZ140845 Motion Kativhu
9,585 Pointsi've typed this but still giving me this massage "Bummer! Remember arrays are 'zero-indexed' meaning the first item in the array is at position 0." where am i going wrong var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick']; console.log (players[0]); console.log (players[1]); console.log (players[2]); console.log (players[3]); console.log (players[4]); console.log (players[5]);

Ishan Vyas
30,284 Pointsthe correct answer is:-
console.log(players[0]);
Rebecca Ung
5,031 PointsRebecca Ung
5,031 Pointsit goes like this
console.log(players[0]);
because you are supposed to put the variable in t