Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftassociated typesSingle-choice MCQ

Given a protocol with an associated type and a default-typed requirement, what does this code print?

protocol Container { associatedtype Item = Int var items: [Item] { get } } struct Box: Container { let items = ["a", "b"] } print(Box().items.count)