*
@method sortBy(<map>, [desc] = false)
@returns Array
@short Sorts the array by <map>.
@extra <map> may be a function, a string acting as a shortcut, or blank (direct comparison of array values). [desc] will sort the array in descending order. When the field being sorted on is a string, the resulting order will be determined by an internal collation algorithm that is optimized for major Western languages, but can be customized. For more information see @array_sorting.
@example

['world','a','new'].sortBy('length')       -> ['a','new','world']
['world','a','new'].sortBy('length', true) -> ['world','new','a']
+   [{age:72},{age:13},{age:18}].sortBy(function(n) {
return n.age;
});                                        -> [{age:13},{age:18},{age:72}]

*
function(map, desc) {
      var arr = this.clone();
      arr.sort(function(a, b) {
        var aProperty, bProperty, comp;
        aProperty = transformArgument(a, map, arr, [a]);
        bProperty = transformArgument(b, map, arr, [b]);
        if(isString(aProperty) && isString(bProperty)) {
          comp = collateStrings(aProperty, bProperty);
        } else if(aProperty < bProperty) {
          comp = -1;
        } else if(aProperty > bProperty) {
          comp = 1;
        } else {
          comp = 0;
        }
        return comp * (desc ? -1 : 1);
      });
      return arr;
    }