I have a JSON object generated based on data stored in a table. I then need to be able to sort it in different ways, but when I do JSON.stringify(array) and try
JSON.stringify(array)
Something of this kind might be on help:
function (obj) { var a = [],x; for(x in obj){ if(obj.hasOwnProperty(x)){ a.push([x,obj[x]]); } } a.sort(function(a,b){ return a[0]>b[0]?1:-1; }) return a; }