Get minimum element from array

 Problem

I have an array and want to get the minimum element (lowest value).



 Recipe


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

// Get minimum element

var min = a.minElement()

print(min!)

				


 Playground