.count property returns an integer that represents how many key-value pairs are in a dictionary.
var fruitStand = ["Apples": 12,"Bananas": 20,"Oranges", 17]print(fruitStand.count)// Output: 3
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.
Learn Swift on Codecademy
Build iOS Apps with SwiftUIBy the end of this Skill Path, you will have created your very own fully functional quiz game for iOS devices—and learned Swift too!
Includes 7 Courses