Document the stableSort function

This commit is contained in:
Guillaume Beraudo
2018-08-06 10:46:54 +02:00
parent a4178d05ef
commit abbfb5c653

View File

@@ -194,8 +194,10 @@ export function equals(arr1, arr2) {
/**
* Sort the passed array such that the relative order of equal elements is preverved.
* See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details.
* @param {Array<*>} arr The array to sort (modifies original).
* @param {Function} compareFnc Comparison function.
* @param {!function(*, *): number} compareFnc Comparison function.
* @api
*/
export function stableSort(arr, compareFnc) {