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 Collections and Control Flow Introduction to Collections Working With Arrays

Amir Fendi
PLUS
Amir Fendi
Courses Plus Student 584 Points

The Array and deletion challenge

Hi there all, till the last step everything was ok ... the last line of this code is halting the pass .... Any suggestions ?

array.swift
// Enter your code below
var arrayOfInts = [44,776,937,551,848,990]
arrayOfInts.append(666)
arrayOfInts += [777]
arrayOfInts[4]
let value = arrayOfInts[4]

1 Answer

Hi Amir,

I put your code into the compiler and it seems like the arrayOfInts[4] is throwing it off as the challenge asks you to retrieve and store the value, not to simply call it. Try removing that one line and see how it works.

Amir Fendi
Amir Fendi
Courses Plus Student 584 Points

This worked fine Thanks but again i'm halted in the next step and asked a question ....