Peter Michaux petermichaux at gmail.com
Sun Oct 21 19:07:50 PDT 2007


Is there a plan for a "clone" function in ES4?

Object.prototype.clone = function() {
        function F() {}
        F.prototype = o;
        return new F();

The earliest reference I have found to this function is a post by  	 	
Lasse Reichstein Nielsen in 2003 on comp.lang.javascript


In the past year this function has been evangelized by Douglas Crockford.


Given the idea has persisted for at least a four year period as
something useful in a prototype-based language, would a clone function
be a good addition to the language itself?


More information about the Es4-discuss mailing list