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 trialAnish Nuni
765 PointsHow do you assign the value of a key to a constant?
Please help me assign key UK to constant ukCurrency
let currencies = ["US":"Dollar" , "UK":"Pound" , "JP":"Yen"]
let ukCurrency =
2 Answers
Mikael Enarsson
7,056 PointsYou would use the string identifier:
let currencies = ["US":"Dollar" , "UK":"Pound" , "JP":"Yen"]
let ukCurrency = currencies["UK"]
Emmanuel Ouzan
4,107 PointsHi Anish Nuni,
I recommend you next time you have a question about the quizzes that you should go back to the last video you have watched and there you will find the answer to the quiz.
It will save you some expensive time ! :)
Good luck,
Emmanuel.
Mikael Enarsson
7,056 PointsThis is good advice.
Anish Nuni
765 PointsAnish Nuni
765 PointsThanks Mikael. The video didn't explain it well and I had been trying for a while, so that is why I turned to the forums. Thanks again!
Mikael Enarsson
7,056 PointsMikael Enarsson
7,056 PointsNo problem ^^ It's useful for me too, it makes me really think about what I know XD