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 trialJeremy Stewart
1,545 PointsDon't understand quiz answer
The quiz question asks me to assign a constant and retrieve the 5th number from the array. The code i've entered does this. What am I doing wrong?
// Enter your code below
var arrayOfInts = [100,200,300,400,500,600]
arrayOfInts.append(700)
arrayOfInts += [800]
let numberFive = arrayOfInts[4]
3 Answers
Alexander Smith
10,476 Pointswhere you have
let numberFive = arrayOfInts[4]
they just wanted it to be named value. Everything else is correct
Sidney Swenson
2,429 PointsCorrect code would just be
let value = arrayOfInts[4]
Jeremy Stewart
1,545 Pointsok thx.
it would be so helpful if you could reveal answers on quizzes. It really stops the learning when the question / answer subtleties are so minimal.