我有以下两个对象:
function circle(radius){
this.radius = radius;
this.foo = function (){
return "circle foo";};
return true;}
function pizza(){
this.foo = function (){
return "pizza foo";};
return true;}
pizza.prototype = new circle(9);
当我执行以下操作时
var foo = myPizza.foo();
它按预期打印以下内容:
比萨饼
如何激活基类并从myPizza
对象打印“circle foo”?