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 trialRicardo Forrest
1,461 PointsHaving trouble appending team to array
var todo = ["Learn Swift", "Build App", "Deploy App"] todo.append("Debug App", "Fix Bugs".)
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo.append("Debug App", "Fix Bugs".)
3 Answers
Steve Hunter
57,712 PointsYou can only use append
one element at a time. So you can either write two append
statements or use the +=
operator to add both elements at once. Use square brackets for the +=
and normal parentheses for the append
method.
Hope that helps!
Steve.
Wallace Pei
6,719 Pointsno semi-colons.
Ricardo Forrest
1,461 PointsThanks a lot, really helped a lot.m:)
Josh Bradford
9,935 PointsDo not place the period at the end of your append method. ("Fix Bugs" . <--- ) I believe that should help.
Steve Hunter
57,712 PointsSteve Hunter
57,712 Pointstodo += ["Debug App", "Fix Bugs"]
or