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 Build a Simple iPhone App with Swift Creating a Data Model Creating a Data Collection

Failure message: Oops! It looks like Task 1 is no longer passing.

That's what I tried:

var shoppingList  = ["toothpaste", "bread", "eggs"]

var cart = shoppingList.removeAtIndex(1)
For better understanding:
Challenge task 2 of 2
We are at the grocery store and we picked up the bread.
Using array subscripting, retrieve the string "bread" from the array and assign it to a variable named cart. 

Failure message: 
Oops! It looks like Task 1 is no longer passing.

What does Pasan mean?

2 Answers

Joseph Kato
Joseph Kato
35,340 Points

Hi Gabriel,

You don't need to remove "bread" from shoppingList; you just need to assign it to the variable cart, using subscripting.

Since "bread" is the second element, it would be something like this:

var cart = shoppingList[1]

Thanks! Works now. :D