如题,使用apply,或者call来模拟
var baseClass = cc.LayerColor.extend({
ctor:function(){
this._super();
},
destory:function(){
console.log("hello,world.");
}
})
var subClass = baseClass.extend({
ctor:function(){
this._super();
},
destory:function(){
BaseLayer.prototype.destory.apply(this,arguments);
}
})
本文探讨了在JavaScript中使用apply和call方法来模拟类继承的过程,提供了具体示例和详细解释。
349

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



