This question already has an answer here:
- Sorting JavaScript Object by property value 10 answers
I have an object like this :
{tsg2b: 1, fjdlf: 0}
Now i need to sort this object based on the value for example i need the result something like this :
{fjdlf: 0,tsg2b: 1}
[{tsg2b: 1}, {fjdlf: 0}]
). You can't keep the same data structure since objects are unordered by specification. – Juhana Oct 23 '13 at 8:42