Created
October 23, 2017 12:38
-
-
Save dmjcomdem/7763d416437f67c9a740ab240e0de597 to your computer and use it in GitHub Desktop.
Object Rename Key
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
if (old_key !== new_key) { | |
Object.defineProperty(o, new_key, Object.getOwnPropertyDescriptor(o, old_key)); | |
delete o[old_key]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment