Skip to content

Instantly share code, notes, and snippets.

@bytespider
Created April 4, 2012 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bytespider/2302889 to your computer and use it in GitHub Desktop.
Save bytespider/2302889 to your computer and use it in GitHub Desktop.
function clone(object) {
var cloned = Object.create(object.prototype || null);
Object.keys(object).map(function (i) {
cloned[i] = object[i];
});
return cloned;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment