高分请教容易问题
1.
var a=b.prototype=new Component();
这句怎么理解,是不是表明a是b的超类,对象原型是什么?
2.
<script type="text/javascript">
function Compute_size()
{
alert(this.height);
return this.height*this.width;
}
function Rectangle()
{
this.height=1;
this.size=Compute_size();
this.height=3;
this.width=4;
}
var a=new Rectangle();
document.write(a.size(),"<br>");
</script>
在Rectangle的构造函数中调用函数Compute_size()为什么alert显示的值是3,而不是1?