arr.sort() function accept function as optional argument for sorting. Here is how it sort the array in asc order.
arr.sort()
asc
arr.sort(function(a, b) { return a - b; })