Get the size of an array

 Problem

I have an Array and want to calculate its size/capacity (how many elements it contains).



 Recipe


// Initialize the Array
var a = [1,2,3]

// Get the size of the array

let size = a.count
print(size)

		
				


 Playground