Sorting arrays

The sort methods available on arrays come in two flavors:

The sorted method returns a new, sorted array:

var randomInts = [233, 6, 85, 1, 6, 24] 
let sortedInt = randomInts.sorted()
print(randomInts) //unchanged

The sort method mutates the array in place:

randomInts.sort()  
print(randomInts) //mutated