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 trial

iOS Swift 2.0 Collections and Control Flow Introduction to Collections Working with Arrays

Code Challenge Help

I'm having trouble with the last step of this code challenge. Can you tell me what the problem is?

arrays.swift
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

Thanks 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) ~~~~~~~~~~~^

Thank you. That second one worked.