Skip to content

Instantly share code, notes, and snippets.

@andrienko
Created March 19, 2014 16:46
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 andrienko/9645907 to your computer and use it in GitHub Desktop.
Save andrienko/9645907 to your computer and use it in GitHub Desktop.
cloning object
if(typeof Object.prototype.clone !== 'function'){
Object.prototype.clone = function(){
var F= function(){};
F.prototype = this;
return new F();
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment