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 trialAlia Khan
3,733 PointsHelp!
it looks fine but it keeps saying your todo variable has the wrong value in it ? what does that mean
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo.append("Debug App , Fix Bugs")
2 Answers
Jhoan Arango
14,575 PointsHello :
When using the append method, you should only add one item at a time.
Now if you want to add one or more items to the array, you can use the += operator.
todo += ["Answer questions","Master Swift","Create an app"]
Keep going, it gets better :)
Mindy Sandilands
15,743 PointsSince you want to add two items to the array I would use the addition assignment operator (+=). This is used if you want to add more than one compatible item to the array.
Try the code below:
var todo = ["Learn Swift", "Build App", "Deploy App"] todo =+["Debug App", "Fix bugs"]
Note that you use brackets with the addition assignment operator and not parenthesis. Hope this helps, Mindy
Alia Khan
3,733 PointsThank you I'll try it now XXX
Alia Khan
3,733 PointsAlia Khan
3,733 PointsHi Thank you so much I'l try that now hahahaahaa I Hope so! X