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

Yun Yin Ku
Yun Yin Ku
1,493 Points

Can't solve the assigning 'arrayOfInts' quest

how do I solve this quiz?? Can anyone help me?

array.swift
// Enter your code below
var arrayOfInts = [0, 1, 2, 3, 4, 5, 6]
arrayOfInts.append(7)
[0, 1, 2, 3, 4, 5, 6] + [7]
arrayOfInts[4]
let arrayofInts[4] = noObj

1 Answer

Gavin Butler
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gavin Butler
iOS Development with Swift Techdegree Graduate 15,489 Points

Hi Yun Yin Ku,

I think the challenge asked for a starting array with 6 elements. That might be tripping it up. Also, when you concatenate an element, you need to assign it back to the array. Try arrayOfInts += [7] For the removal of an element, the challenge asks you to assign it to a constant called 'discardedValue' so start with let discardedValue = then use the .remove method on the array. hope this helps...