由森图书馆排序

http://swannodette.github.io/mori/#sortBy

稳定?

(在这种意义上稳定:https://softwareengineering.stackexchange.com/questions/247440/what-does-it-mean-for-a-sorting-algorithm-to-be-stable

最佳答案

简而言之-是的

它没有在文档中描述,但是... Mori使用Clojure脚本中的排序方式(在mori存储库中没有sortBy的其他实现)
https://github.com/swannodette/mori/blob/master/src/mori.cljs#L30

(mori-export sortBy cljs.core/sort-by)


cljs实现sort-by
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L2328

使用声称稳定的Google Closure库
https://github.com/google/closure-library/blob/master/closure/goog/array/array.js#L1144

10-06 04:23