Tylerc230
Tylerc230

Reputation: 2893

Why does filter always return an Array?

I'm using swift 1.2.

When I invoke

let filtered = filter(mySet, <some condition>)

, I would think that filtered would have the same collection type as mySet but it is always an array.

I'm wondering what the logic is since a Set, for instance, doesn't have an order.

Upvotes: 0

Views: 81

Answers (0)

Related Questions