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 trialGabriel Kroll
9,823 PointsFailure 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)
2 Answers
Joseph Kato
35,340 PointsHi 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]
Gabriel Kroll
9,823 PointsThanks! Works now. :D
Gabriel Kroll
9,823 PointsGabriel Kroll
9,823 Points