MCPcopy
hub / github.com/lodash/lodash / baseSortBy

Function baseSortBy

lodash.js:944–952  ·  view source on GitHub ↗

* The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order

(array, comparer)

Source from the content-addressed store, hash-verified

942 * @returns {Array} Returns `array`.
943 */
944 function baseSortBy(array, comparer) {
945 var length = array.length;
946
947 array.sort(comparer);
948 while (length--) {
949 array[length] = array[length].value;
950 }
951 return array;
952 }
953
954 /**
955 * The base implementation of `_.sum` and `_.sumBy` without support for

Callers 1

baseOrderByFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected