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 trialNeiv Schwartz
1,537 PointsCode Challenge Help
I'm having trouble with the last step of this code challenge. Can you tell me what the problem is?
var arrayOfInts: [Int] = [4, 6, 1, 9, 2, 7]
arrayOfInts.append(2)
arrayOfInts += [4]
let value = arrayOfInts[6]
arrayOfInts.removeAtIndex(5)
let discardedValue = arrayOfInts(5)
1 Answer
Chris Stromberg
Courses Plus Student 13,389 PointsTry this.
let discardedValue = arrayOfInts.removeAtIndex(5)
Neiv Schwartz
1,537 PointsNeiv Schwartz
1,537 PointsThanks Chris. I tried that, but I am getting this error message:
swift_lint.swift:11:33: error: cannot call value of non-function type '[Int]' let discardedValue = arrayOfInts(5) ~~~~~~~~~~~^
Neiv Schwartz
1,537 PointsNeiv Schwartz
1,537 PointsThank you. That second one worked.