Skip to content

Instantly share code, notes, and snippets.

@Avaray
Created May 11, 2018 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Avaray/94fd0fbf8450b7625b21b0ece574b3a7 to your computer and use it in GitHub Desktop.
Save Avaray/94fd0fbf8450b7625b21b0ece574b3a7 to your computer and use it in GitHub Desktop.
[JS] Sort Keys in Object alphabetically
let a = {};
Object.keys(b).sort().forEach(key => {
a[key] = b[key];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment