Created
May 11, 2018 00:18
-
-
Save Avaray/94fd0fbf8450b7625b21b0ece574b3a7 to your computer and use it in GitHub Desktop.
[JS] Sort Keys in Object alphabetically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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