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 Swift Basics (retired) Collections What is a Dictionary?

let item = countries.removeValueForKey("CA")

i don't know what's the benefit of making a removable code as a constant !! even in previous lesson in Array the professor made the same step what's the benefit??

Lukas Smith
Lukas Smith
4,026 Points

just for You :) i don't need to do this :D

aha thank you Mr.Lukas Smith :)

cheers Nour..

1 Answer

Amit Kalra
Amit Kalra
3,078 Points

It's preparing you for future projects, when you see something you don't want anymore and can't find the code, because there will be a lot of code, you can just remove it with this command. You don't have to use this if you don't want to.