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 trialAlejandro Jiménez-Flores
Full Stack JavaScript Techdegree Student 14,981 PointsChallenge Task 2 does not accept the correct answer
console.log(players[5]); gives an incorrect answer.
const players = ['Toni', 'Anwar', 'Mali', 'Carlos', 'Cormac', 'Sariah'];
console.log(players[5]);
1 Answer
Brandon White
Full Stack JavaScript Techdegree Graduate 34,662 PointsHi Alejandro,
If the code you’ve posted is the way you posted it in the challenge, then the issue you’re running into is that the code for the first challenge is missing.
The idea for these challenges is to add on to the previous challenge. In this case, the second challenge asks that you print the last element in the array on the next line, but instead you’ve replaced the code for the first challenge. So instead of printing the first element and last element in the array, you’re only printing out the last.
Alejandro Jiménez-Flores
Full Stack JavaScript Techdegree Student 14,981 PointsAlejandro Jiménez-Flores
Full Stack JavaScript Techdegree Student 14,981 Pointsgot it! Thank you Brandon for your prompt response!