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 trialJohn Moron
1,658 PointsHow do I remove "Deploy App"
I need help.
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo.append("Debug App")
todo.append("Fix Bugs")
6 Answers
Dominic Bryan
14,452 Pointslet item = todo.removeAtIndex(2)
sorry as I was typing this got posted
Steve Hunter
57,712 PointsI'm not at my computer, and am no expert, but is there a .removeAtIndex(index) method?
Steve.
John Moron
1,658 PointsIt said that but I don't know how to write that in?
Steve Hunter
57,712 Pointstodo.removeAtIndex(2)
John Moron
1,658 Pointsohh like that?!!!
John Moron
1,658 Pointsso how do I write it actually....?
John Moron
1,658 PointsNever mind I typed it wrong....
Dominic Bryan
14,452 Pointshaha i was just about to say John, again if you want it ive just done the question and this is the copy and paste:
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo.append("Debug App")
todo.append("Fix Bugs")
let item = todo.removeAtIndex(2)
Steve Hunter
57,712 PointsYou fixed now? Let us know if we can help with anything else ...
Keep up the coding - it does get easier (and more interesting!!). Swift can do some pretty cool stuff - keep at it!
Steve.
John Moron
1,658 PointsJohn Moron
1,658 PointsThank you Dominic Bryan.
Dominic Bryan
14,452 PointsDominic Bryan
14,452 Pointsyes sorry Steve Hunter I didn't mention ti was for a question on a track that wants it in a constant named item. Apologies for confusion
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsNo problem, Dominic Bryan - but remember, you can't alter constants.
Happy coding ... keep it up!