Javascript Array.sort implementation?

后端 未结 9 1698
难免孤独
难免孤独 2020-11-22 06:58

Which algorithm does the JavaScript Array#sort() function use? I understand that it can take all manner of arguments and functions to perform different kinds o

9条回答
  •  礼貌的吻别
    2020-11-22 07:45

    JavaScript's Array.sort() function has internal mechanisms to selects the best sorting algorithm ( QuickSort, MergeSort, etc) on the basis of the datatype of array elements.

提交回复
热议问题