Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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