Skip to content

Instantly share code, notes, and snippets.

@radar
Created December 8, 2009 00:23
Show Gist options
  • Save radar/251289 to your computer and use it in GitHub Desktop.
Save radar/251289 to your computer and use it in GitHub Desktop.
// Each object in the json has a name. That's it. This will sort them.
json = json.sort(function (a,b) {
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment