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


Bryan Beasman
Bryan Beasman
3,435 Points

Append vs Concatenation

Right now I am learning about adding items to an array in swift. I have learned that one can add elements to the end of an array using the append method and also by concatenating 2 arrays together. Why does the append method exist if I can just concatenate? I am trying to figure out which method of adding elements to an array I should use more often moving forward, but they both seem like they do the same exact thing.

1 Answer

Hi Bryan,

Yup: both those methods do exactly the same thing. So, it doesn't matter which one you use. Just pick one ;)