Last active
August 29, 2015 14:25
-
-
Save PatrickJS/0a04b44f5ab2d44f677c to your computer and use it in GitHub Desktop.
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
| // Copy an Object with property descriptors | |
| var copy = Object.create(Object.getPrototypeOf(node)); | |
| Object.getOwnPropertyNames(node).forEach(propName => { | |
| Object.defineProperty(copy, propName, Object.getOwnPropertyDescriptor(node, propName)); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment