Last active
December 14, 2018 02:25
-
-
Save StevenACoffman/833d538d896eefd314e48c5d95f4f7aa to your computer and use it in GitHub Desktop.
Rename object
This file contains hidden or 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
renameProp = (oldProp, newProp, {[oldProp]:old, ...others}) => ({ [newProp]: old, ...others }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://medium.com/front-end-hacking/immutably-rename-object-keys-in-javascript-5f6353c7b6dd