Get minimum element from array


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


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

// Get minimum element

var min = a.minElement()



Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)