Properties in Swift, allow us to access a value that is specific to a particular structure. We can use the
.count property of an array to give us a number value of elements inside the array.
For example, suppose we have an array called
grocery with some emojis:
var grocery = ["🥓", "🥞", "🍪", "🥛", "🍊"]
When we print out
The output will look like this:
This property will come in extra handy when the array is lengthy.
It takes too long to count the number of elements in
countingRhyme with your eyes.
Print the size of the array using