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 trialFinlay Schlieper
6,935 PointsObjective 3/3 I write todo.insert(""Learn iOS", atIndex: 1) but then it says todo array has wrong value
Please Help
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo.append("Debug App")
todo.append("Fix Bugs")
todo.removeAtIndex(1)
let item = todo.removeAtIndex(1)
todo.insert("Learn iOS", atIndex: 1)
2 Answers
Steve Hunter
57,712 PointsHi,
I think you got a couple of bits slightly wrong there so the array doesn't look as expected at the end of the exercise.
My solution looks like:
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo.append("Debug App")
todo.append("Fix Bugs")
let item = todo.removeAtIndex(2)
todo.insert("Learn iOS", atIndex: 1)
Finlay Schlieper
6,935 PointsThanks a ton Steve. That really helped. It works now.
Steve Hunter
57,712 PointsNo problem! :-)