function Base(){
}
Base.prototype.say = function(){
console.log(1);
}
function Sub(){
}
Sub.prototype = new Base();
Sub.prototype.say = function(){
//todo: 不使用__proto__调用base.say();
console.log('2');
}
var son = new Sub();
son.say() // Expect: log: 1,2;
请问有什么方式可以实现吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
function Base(){