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 trial

iOS Swift Basics (retired) Collections Modifying an Array

kevin chang
kevin chang
408 Points

I don't get it help

i need help

arrays.swift
var todo = ["Learn Swift", "Build App"]
todo.append("Debug App")
todo.append("Fix Bugs")
let Item =  ("Deploy App")

To Solve: Now that we have to fix bugs in our app we cannot deploy it. Please remove the third item ("Deploy App") and assign it to a constant named item.

Before you can reassign "Deploy App" to a let, you first must remove it from the array like...

var todo = ["Learn Swift", "Build App", "Deploy App"]

todo.append("Debug App")

todo.append("Fix Bugs")

todo.removeAtIndex(2) //This line here is what you are missing. Code this in first and this see if you can figure out how to assign it to a let item. Also, we use the number two since "Deploy App" is the third object in the array and arrays objects are counted starting from 0, 1, 2, 3,...