Solution Sort By
Code
# Code
```javascript []
/**
 * @param {Array} arr
 * @param {Function} fn
 * @return {Array}
 */
var sortBy = function(arr, fn) {
    return arr.sort((first, second ) => fn(first) > fn(second) ? 1 : -1)
};
```
['JavaScript']