I'm using lodash, and here's some sample code:
var stuff = [{a: 100}, {a: 90}];
var res1 = _.sortBy(stuff, function(st) {
return [st.a];
});
var res2 = _.sortBy(stuff, function(st) {
return st.a;
});
console.log(res1);
console.log(res2);
This returns:
[{a: 90}, {a: 100}]
[{a: 100}, {a: 90}]
Why does it switch when an array is returned?