EcmaScript hasn't have the stable sort method yet.
http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.sort

Sure, we can create stable sort function by using `Array#sort`,
by returning the number of index (e.g. `arr.indexOf(arguments[0]) - 
arr.indexOf(arguments[1])`)
when it is equal to both arguments value in `comparefn`.
But this is inefficient and perplexing.

So, I propose below.

`Array#stableSort(comparefn)`

or

`Array#sort(comparefn, isStable = false)`


Thanks!
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to