Welcome to the Treehouse Community
Looking to learn something new?
Jason Hoddinott477 Points
You also need to use array concatenation to pass the task! To concatenate two arrays, use the + operator.
I'm starting to get a little annoyed at the Challenges. We learn through the videos how to use Strings to build the Array, but then in the Challenge we have to use Int. Nothing I'm doing is working because I'm getting an error in Xcode "Cannot cal value of non-function type '[Int]'
Why do we learn it one way, and then there's no help when we have to use another method?
// Enter your code below var arrayOfInts: [Int] = [1,2,3,4,5,6] arrayOfInts.append(7) arrayOfInts = arrayOfInts + 8
Martin WildfeuerCourses Plus Student 11,071 Points
The thing is that by
arrayOfInts = arrayOfInts + 8 you are trying to concatenate an array, that is
[Int], with an
Instead you have add an
[Int] to an
[Int] instead, that is merging two arrays. The following works:
var arrayOfInts: [Int] = [1,2,3,4,5,6] arrayOfInts.append(7) arrayOfInts = arrayOfInts +  // variation: arrayOfInts += 
P.S. It does not make a difference it it's an array of Ints or Strings, it could be any Element. The concept does not differ here.
Hope that helps :)