1 function inherit(subClass,supperClass){ 2 function temp(){}; 3 temp.prototype = supperClass.prototype; 4 subClass.prototype = new temp(); 5 subClass.prototype.constructor = cubClass; 6 }
1 function inherit(subClass,supperClass){ 2 function temp(){}; 3 temp.prototype = supperClass.prototype; 4 subClass.prototype = new temp(); 5 subClass.prototype.constructor = cubClass; 6 }
转载于:https://www.cnblogs.com/adullboy/archive/2013/04/08/3008823.html