Skip to content

Instantly share code, notes, and snippets.

@smcelhinney
Created December 31, 2014 09:10
Show Gist options
  • Save smcelhinney/d9d98783580622d474f5 to your computer and use it in GitHub Desktop.
Save smcelhinney/d9d98783580622d474f5 to your computer and use it in GitHub Desktop.
function clone(obj) {
let proto = Object.getPrototypeOf(obj);
return Object.assign(Object.create(proto), obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment