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 trialVeronise Umutoni
512 PointsI am having trouble inserting an item (Learn iOS)in the todo array.
The code is working in my computer playground but when i try to learn it in the challenge test it is return an error.
Thank you for you 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)
4 Answers
viplove bansal
Courses Plus Student 2,170 Pointsvar 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)
you are removing "build App" and in challenge we have to remove "deploy App"
Veronise Umutoni
512 PointsThank you....that works!!
viplove bansal
Courses Plus Student 2,170 Pointsyu welcome :)
Alejandro Reyes
Courses Plus Student 1,927 PointsI m having trouble answering this, I dont understand why is this wrong, someone 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)
It says "Your todo variable has the wrong value in it"
Please Help!
viplove bansal
Courses Plus Student 2,170 Pointsvar 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)
yu re removing wrong value