var myfunc1 = function(){
this.prototype = {};
this.prototype.name = 'Lee';
this.prototype.myTxt = function(txt) {
console.log( 'i am myfunc1',txt );
}
}
var myfunc2 = function(){
}
myfunc2.prototype = new myfunc1();
myfunc2.prototype.name = 'abc';
myfunc2.prototype.myTxt = function(txt){
//console.log(this.prototype);
this.prototype.myTxt.call(this,txt);
console.log( 'i am myfunc2',txt );
}
var myfunc3 = new myfunc2();
myfunc3.myTxt('Geing');
console.log (myfunc3.name);
博客围绕JavaScript中的重写展开,但具体内容缺失,推测会涉及重写的概念、实现方式及应用场景等信息技术相关内容。
335

被折叠的 条评论
为什么被折叠?



