当前位置:网站首页>Inheritance -- holy grail mode

Inheritance -- holy grail mode

2022-06-26 00:57:00 ivanfor666

var grailMode = (function () {
    return function (Origin, Target) {
        var Temp = function () {
        };
        //  Temporary constructor 
        Temp.prototype = Origin.prototype;
        Target.prototype = new Temp();
        //  Add a temporary constructor 
        Target.prototype.constructor = Target;
        //  Target constructor prototype properties constructor Point to   Target constructor 
        Target.prototype.ancestor = Origin;
        // target  My father 
    }
})();

原网站

版权声明
本文为[ivanfor666]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206252240330149.html