Javascript Array.sort implementation?

后端 未结 9 1696
难免孤独
难免孤独 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:46

    After some more research, it appears, for Mozilla/Firefox, that Array.sort() uses mergesort. See the code here.

提交回复
热议问题