If I have a JavaScript object like this:
var data = {
words: ["you", "me", "foo", "bar"],
numbers: [ 160 , 20, 100, 80]
};
Is there a way to sort the properties based on value? So that I end up with
var data = {
words: ["you","foo","bar", "me" ],
numbers: [160, 100, 80, 20]
};