Skip to content

Instantly share code, notes, and snippets.

@robozevel
Created April 20, 2015 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robozevel/b92a124109e21e5ab7e1 to your computer and use it in GitHub Desktop.
Save robozevel/b92a124109e21e5ab7e1 to your computer and use it in GitHub Desktop.
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