array.sort [method]
array.sort([ bool reverse ])
sorts the array using the sgs_Compare C API function for comparisons, returns the array for chaining
- if
reverse
is true, array is sorted in the reverse order
a = [ 6, 8, 7, 5 ]; a.sort(); // a = [5,6,7,8]