October 2010
1 post
1 tag
How do you sort a Javascript object?
In my last project at work, I had to work with fairly large data structures in Javascript. More than once I needed to sort data stored in Javascript objects. Javascript objects are by definition unsorted, so naturally there is no built-in way of doing this. All browsers, however, keep objects in the order that properties were added, so I decided to write a comprehensive sorting function.
This...