Skip to content

Instantly share code, notes, and snippets.

@OscarGodson
Forked from bytespider/gist:2302889
Created April 25, 2012 21:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OscarGodson/2493621 to your computer and use it in GitHub Desktop.
Save OscarGodson/2493621 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