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 trialjeremiahjacquet
16,885 PointsWhat's wrong with my constant?
assigning a constant named 'value' and assigning it the 5th place in the index seems pretty straight forward yet the compiler is telling me its incorrect. Looking at the video from your group and apple documentation it appears that i am writing it correctly. Is there a an error on your end or mine?
// Enter your code below
var arrayOfInts = [0,1,2,3,4,5]
arrayOfInts.append(4)
arrayOfInts += [7]
arrayOfInts.value(4)
let value = arrayOfInts[4]
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You have one line that's causing the problem. This isn't a valid Swift statement for arrays. Remove this:
arrayOfInts.value(4)
Hope this helps!
jeremiahjacquet
16,885 Pointsjeremiahjacquet
16,885 PointsI shouldn't do this while I am falling asleep anymore, thanks.