General topic questions
Some vs Any
HardOccasional
Free section · general topics & algorithms
Explain some vs any for protocols in Swift.
Reveal model answer
some is an opaque type—fixed concrete type known to compiler, better performance. any is an existential—dynamic type, more flexible, potential heap allocation/boxing. Prefer some at API boundaries when possible.