arr.sort(fn)
Let arr = [ 1, 2, 15 ];
// the method reorders the content of arr (and returns it)
arr.sort();
alert( arr ); // *!*1, 15, 2*/!* The method arr.sort sorts the array in place.
The arr.sort(fn) method has a built-in implementation of sorting algorithm.
Semantic portal