1var arr = arr.sort(function(a,b) {
2 return order.indexOf( a.key ) - order.indexOf( b.key );
3 //for the sake of recent versions of Google Chrome use:
4 //return a.key.charCodeAt(0) > b.key.charCodeAt(0); or return a.key.charCodeAt(0) - b.key.charCodeAt(0);
5});
6
1var arr = arr.sort(function(a,b) {
2 return order.indexOf( a.key ) - order.indexOf( b.key );
3});
4