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 trialBrian Patterson
19,588 PointsAnother badly worded question.
I understand arrays but this challenge is really badly put. I don't understand why it keeps telling me that this wrong. // Enter your code below var arrayOfInts: [Int] = [1,2,3,4,55,78]
arrayOfInts.append(44)
arrayOfInts += [55]
let seventyEight = arrayOfInts[5]
// Enter your code below
var arrayOfInts: [Int] = [1,2,3,4,55,78]
arrayOfInts.append(44)
arrayOfInts += [55]
let seventyEight = arrayOfInts[5]
2 Answers
Christian Kroul
9,849 PointsCorrect Code
var arrayOfInts = [1,2,3,4,5,6]
arrayOfInts.append(44)
arrayOfInts += [7]
let value = arrayOfInts[4]
let discardedValue = arrayOfInts.removeAtIndex(5)
Christian Kroul
9,849 PointsIt does nothing really, just that's how the code challenge wants you to do
Jacob Dobson
5,122 PointsJacob Dobson
5,122 PointsI don't get why you need to assign "value" and "discardedValue" wouldn't arrayOfInts.removeAtIndex(5) be all that you need to do type?