Array vs some Collection

Here’s the code if you want to experiment with it!

import Foundation

struct User {
    let firstName: String
}

func display(users: some Collection<User>) {
    for user in users {
        print(user)
    }
}
Previous
Previous

shorthand if-let syntax

Next
Next

where in a for-loop