diff --git a/lodash.src.js b/lodash.src.js index 149b8c854..80ddc321e 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -2846,12 +2846,14 @@ * @returns {Array} Returns the new sorted array. */ function baseSortByOrder(collection, iteratees, orders) { - var callback = getCallback(); + var callback = getCallback(), + index = -1; + iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); }); - var result = baseMap(collection, function(value, index) { + var result = baseMap(collection, function(value) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); - return { 'criteria': criteria, 'index': index, 'value': value }; + return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) {