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 trialAlia Khan
3,733 PointsStuck!
it asks to assign the value for the key `uk to a constant named ukCurrency so the value for the key uk is pound and I've named the constant ukCurrency so why is it wrong? Thanks
let currencies = ["US": "Dollar" , "UK":"Pound" ,"JP":"Yen"]
let ukCurrency = ["Pound"]
1 Answer
Jhoan Arango
14,575 PointsHello Alia:
The challenge says : Assign the value for key "UK" to a constant named ukCurrency.
So you have to give the value for the key “UK” to a constant name ukCurrency. Meaning that you don’t have to directly give it “Pound”, you have to use the Key.
let ukCurrency = currencies["UK"]
What you were doing in your answer was creating an Array name ukCurrency with a single item in it.
Hope you get it now, if you need more help please let me know or tag me in your questions with @jhoanarango
Alia Khan
3,733 PointsAlia Khan
3,733 Pointsomg i swear I tried that and it wouldn't accept it ! haha I'll do it again thank you so much Jhoan I will do
oops just checked i didnt add the currencies bit why is that neccersary?
Jhoan Arango
Jhoan Arango
14,575 PointsJhoan Arango
14,575 PointsAlia:
It’s the only way the system knows what you are talking about, otherwise it would be lost.
Say that you have different dictionaries, how would the system know which key from which dictionary you are talking about?
For Example
That’s why it is necessary :)
Hope this explanation helps you understand a bit better. It will make more sense as you practice
Happy coding, and remember to use @jhoanarango if you need more details :)