Skip to content

Instantly share code, notes, and snippets.

@chrisforrette
Created December 17, 2016 00:52
Show Gist options
  • Save chrisforrette/93decd83afb591e53831a88e40a4608c to your computer and use it in GitHub Desktop.
Save chrisforrette/93decd83afb591e53831a88e40a4608c to your computer and use it in GitHub Desktop.
Change object value to object
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