javascript 继承实现

function extend(subClass, superClass){
            var C=function(){};
            C.prototype=superClass.prototype;
            subClass.prototype=new C();
            subClass.prototype.constructor=subClass;
            subClass.superClass=superClass.prototype;
            if(superClass.prototype.constructor == Object.prototype.constructor){
                superClass.prototype.constructor=superClass;
            }
        }

  

原文地址:https://www.cnblogs.com/dubaokun/p/3455476.html