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!

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

not quite sure if I typed this out correctly?

can I please get some help with this array question

var arrayOfInts = [1,2,3,4,5,6]
arrayOfInts.append ("7")
[1,2,3,4,5,6] + [7]

1 Answer

John Marley
John Marley
8,740 Points


In appending the array, the quotation marks around the "7" mean it is a String; arrays are 'homogenous' and can only accept one type of data like Ints, Strings, Doubles etc.

// arrayOfStrings would look like ["this", "is", "a", "string"]


The String concatenation you've done at the bottom passes the challenge too.

I hope this helps :)