Skip to content

Instantly share code, notes, and snippets.

@eliaskg
Created November 25, 2009 21:10
Show Gist options
  • Save eliaskg/243030 to your computer and use it in GitHub Desktop.
Save eliaskg/243030 to your computer and use it in GitHub Desktop.
var test = [{"name": "a", "adress": "b"}, {"name": "b", "adress": "a"}];
test_sorted = test.sort(function (obj1, obj2) {
return obj1.adress < obj2.adress ? -1 : (obj1.adress > obj2.adress ? 1 : 0);
});
console.log(test_sorted);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment