Sorting an object?
- by dfjhdfjhdf
How to sort this object lexicographically by its keys:
var obj = {'somekey_B' : 'itsvalue', 'somekey_A' : 'itsvalue');
so that it outputs like this:
for (k in obj) {
alert(k + ' : ' + obj[k]); //first "somekey_A : itsvalue"; then "somekey_B : itsvalue"
}