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 Basics (retired) Collections Modifying an Array

Ricardo Forrest
Ricardo Forrest
1,461 Points

Append

Any solutions ?

We need to append a few more items to our todo array. Append the following strings: "Debug App", "Fix Bugs".

1 Answer

Francisco Navarro
Francisco Navarro
14,185 Points

Hi Ricardo,

I think to add items to an array you can do it in two ways:

1) Append method:

todo.append("Debug App") todo.append("Fix Bugs")

2) +=

todo += ["Debug App","Fix Bugs"]

The second one fit better as you can add two items in a row. Hope that helps