Anyone know why Safari 5 (Windows 7) can't sort arrays of objects?
var arr = [{a:1},{a:3},{a:2}];
console.log(arr[0].a+','+arr[1].a+','+arr[2].a);
arr.sort(function(a,b){return a.a > b.a;});
console.log(arr[0].a+','+arr[1].a+','+arr[2].a);
The console result should be
1,3,2
1,2,3
This works fine in FF and IE but Safari returns:
1,3,2
1,3,2