let's say I have such weird code:
var weirdo = {};
var ids = [10, 30, 11, 1, 4, 2];
var producers = ['Ford','Rover','BMW','Fiat','Renault','Mitsubishi'];
var n = producers.length;
for(var i=0; i<n; i++) {
weirdo[ids[i]] = producers[i];
}
// unknown code ???
How to sort weirdo by values? It's not array and no, I can't sort producers before filling weirdo.
Any ideas?
Oh, and relation id <=> producer is VERY IMPORANT!