1. If the data size is less than or equal to 10 is normal
2. Data size greater than 10
Implementation principle of Array.Sort in 3.js
Definition: the sort () method is used to sort the elements of an array.
API syntax: Arrayobject.sort (sortby), parameter SortBy optional, used to specify collation, must be a function.
How is it implemented?
The V8 engine sort function gives only two sorts: Insertionsort and QuickSort, the array length is less than or equal to 10 with the insertion sort insertionsort, and the 10 larger array uses the Quick sort QuickSort
Address: Https://github.com/v8/v8/blob/master/src/js/array.js
Mozilla/firefox: Merge sort (jsarray.c source)
Webkit: The underlying implementation uses the Qsort () method in the C + + library (JSArray.cpp source code)
Reference Link: http://blog.csdn.net/coder_chenz/article/details/77156047
Array.Sort Google core array size more than 10 sorted fields are returned in an array that is not the original array