2011/5/27 Björn Söderqvist <[email protected]>: > I have an object whose properties are not alphabetically sorted, like so: > {a:1, c:3, b:2} > I would now like to have a function which can return a similar object, > only with the properties sorted alphabetically: > {a:1, b:2,c:3} >
If it's essential that you have an ordered representation, use an array: [['a', 1], ['b', 2], ['c', 3]]; -- Nick Morgan http://skilldrick.co.uk @skilldrick -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
