Sort array in ascending order


I have an Array and want to sort its contents (numeric or lexicographically) in ascending order.


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

// Sort (ascending) its elements

a = a.sort { $0 < $1 }

Heard the news?

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