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
Lewis Mansbridge1,119 Points
Hi there, i have copied the exact video, but still says its not correct, any ideas ? Thank you
Not working but does on my mac in front of me :(
var todo = ["Learn Swift", "Build App", "Deploy App"] todo.append("Debug App", "Fix Bugs")
Greg Kaleka39,021 Points
I haven't watched the video, but that can't be a copy of the code there. The
append method only takes a single parameter, so your code would cause an error. Instead, you have to call the method twice, once per string you want to add to the array:
var todo = ["Learn Swift", "Build App", "Deploy App"] todo.append("Debug App") todo.append("Fix Bugs")
Alternatively, you can add arrays together (called concatenation, as with strings), rather than appending individual items:
var todo = ["Learn Swift", "Build App", "Deploy App"] todo += ["Debug App", "Fix Bugs"]
Both of these work - up to you which one you choose!