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

How can i pass this section? I am stuck. Can you help me?

I don't understand that where do i make a mistake?

2 Answers

Marina Alenskaja
Marina Alenskaja
9,320 Points

Hi!

Next time it's a really good idea to include your code in the question. That way we can see where your error is. But here is how the answer should look like:

var arrayOfInts = [2,3,4,6,3,4] 

arrayOfInts.append(10)
arrayOfInts += [7]
let value = arrayOfInts[4]
let discardedValue = arrayOfInts.removeAtIndex(5)

Of course the numbers can be anything. :-)

Thanks a lot. Actually I assumed add the code in my question but i didn't. Thanks for the answer :)