Created
December 17, 2016 00:52
-
-
Save chrisforrette/93decd83afb591e53831a88e40a4608c to your computer and use it in GitHub Desktop.
Change object value to object
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
Object | |
.keys(obj) | |
.reduce((accumulator, key) => { | |
accumulator[key] = { | |
'newkey': obj[key] | |
}; | |
return accumulator; | |
}, {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment