JSFiddle - React, Tailwind, and code Playground
JavaScript
var someObj = {
3: {
amount: 30,
key: 'abc'
},
4: {
amount: 20,
key: 'def'
},
};
var res = $.map(someObj, function(v) { return v });
res.sort(function(a, b) {
return a.amount - b.amount;
});
console.log(res);