Skip to content

Instantly share code, notes, and snippets.

@justsml
Created June 7, 2015 19:28
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 justsml/ce1f82472a57fb87b3e6 to your computer and use it in GitHub Desktop.
Save justsml/ce1f82472a57fb87b3e6 to your computer and use it in GitHub Desktop.
function extend(obj, src) {
Object.getOwnPropertyNames(src)
.forEach( (propName) => Object.defineProperty(obj, propName, Object.getOwnPropertyDescriptor(src, propName)) );
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment