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 trialMalthe Pedersen
2,338 PointsIt really frustrates me, that I am not able to do this!!!!!!!!!!!!!!!! I do not understand your errors!
I cannot assign the value of UK to a constant named ukCurrency....................
let currencies = [ "US": "Dollar", "UK": "Pound", "JP": "Yen"]
let ukCurrency = currencies.removeValueForKey("UK")
ukCurrency
3 Answers
kjvswift93
13,515 Pointslet currencies = ["US": "Dollar", "UK": "Pound", "JP": "Yen"]
let ukCurrency = currencies["UK"]
This is the correct answer for the challenge.
Rob Watts
2,739 PointsYou almost had this right: your initial array, currencies, was declared as a constant. Constants are not mutable, therefore you cannot use the removeValueForKey method. Change your "let" to "var" and it will work.
Malthe Pedersen
2,338 PointsUnfortunaly not, I already tried that, then it says something about, that it needs to be a constant not a variable
Rob Watts
2,739 PointsReally? Take a look at this screenshot. It's working in my playground: https://dl.dropboxusercontent.com/u/526349/swift.png