Created
April 20, 2015 08:18
-
-
Save robozevel/b92a124109e21e5ab7e1 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
function create(proto, obj) { | |
var descriptor = {}; | |
Object.keys(Object(obj)).forEach(function(prop) { | |
descriptor[prop] = Object.getOwnPropertyDescriptor(obj, prop); | |
}); | |
return Object.create(proto || null, descriptor); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment