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 trialRaidel Rivero
1,679 PointsWhat happened to Nick?
var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick']; console.log(players[5]);
//Should return Nick right?
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
Nick Trabue
Courses Plus Student 12,666 PointsThis works in the console for me.
Dane Parchment
Treehouse Moderator 11,077 PointsAre you actually running into errors or are you just asking if it should return Nick?
If it is the former, then what errors are you running into? The code you have provided should work perfectly fine!
If it is the latter, then yes it will return Nick, as Nick is in the 5th index.
Raidel Rivero
1,679 PointsThanks everyone! Stivan was right. My issue was that I did not keep both lines of code in sequence. Technically it should have worked but the interpreter did not accept it as the right answer. Once again thanks very much!
ygh5254e69hy5h545uj56592yh5j94595682hy95
7,934 Pointsygh5254e69hy5h545uj56592yh5j94595682hy95
7,934 PointsKeep both of them together: try: