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 2.0 Collections and Control Flow Dictionaries Recap: Dictionaries

MIchael Montoya
MIchael Montoya
3,222 Points

Why are these False? Dictionaries.

The following code snippets are equivalent

dict.updateValue("yetAnotherValue", forKey: 3) and dict[3] = "yetAnotherValue"

They both seem to do the same thing to me.

Thanks in advance!

2 Answers

Michael, good catch! They are equivalent, if by "equivalent" you mean "do the same thing" (rather than, say, spelled the same)!. And I don't know what other definition of equivalence Treehouse would be using.

You should report the bug to Treehouse.

MIchael Montoya
MIchael Montoya
3,222 Points

Thank goodness. I was looking frantically for what I missed. Thanks!